about summary refs log tree commit diff stats
path: root/src/js/tojs.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-11 18:25:46 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-11 18:25:46 +0100
commitaeb9b9e5dddf3102773aa900865fe11a91cd65a6 (patch)
treeebd82f907877ea9caf3826f5ce993772e714d36c /src/js/tojs.nim
parent14c9c373a89ddd2c64d4178877db168253ff776d (diff)
downloadchawan-aeb9b9e5dddf3102773aa900865fe11a91cd65a6.tar.gz
js: merge some type modules into jstypes
They only had type definitions, no need to put them in separate modules.
Diffstat (limited to 'src/js/tojs.nim')
-rw-r--r--src/js/tojs.nim12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/js/tojs.nim b/src/js/tojs.nim
index 91b1128e..2936ba28 100644
--- a/src/js/tojs.nim
+++ b/src/js/tojs.nim
@@ -13,7 +13,7 @@
 # * JSArrayBuffer, JSUint8Array are converted to a JS object without copying
 #   their contents.
 # * NarrowString is converted to a JS narrow string (with copying). For more
-#   information on JS string handling, see js/strings.nim.
+#   information on JS string handling, see js/jstypes.nim.
 # * Finally, ref object is converted to a JS object whose opaque is the ref
 #   object. (See below.)
 #
@@ -42,11 +42,9 @@ import std/unicode
 
 import bindings/quickjs
 import io/promise
-import js/arraybuffer
-import js/dict
 import js/error
+import js/jstypes
 import js/opaque
-import js/strings
 import js/typeptr
 import types/opt
 
@@ -60,7 +58,7 @@ proc toJS*(ctx: JSContext, n: int): JSValue
 proc toJS*(ctx: JSContext, n: uint16): JSValue
 proc toJS*(ctx: JSContext, n: uint32): JSValue
 proc toJS*(ctx: JSContext, n: uint64): JSValue
-proc toJS*(ctx: JSContext, n: SomeFloat): JSValue
+proc toJS*(ctx: JSContext, n: float64): JSValue
 proc toJS*(ctx: JSContext, b: bool): JSValue
 proc toJS*[U, V](ctx: JSContext, t: Table[U, V]): JSValue
 proc toJS*(ctx: JSContext, opt: Option): JSValue
@@ -158,8 +156,8 @@ proc toJS*(ctx: JSContext, n: uint64): JSValue =
   #TODO this is incorrect
   return JS_NewFloat64(ctx, float64(n))
 
-proc toJS*(ctx: JSContext, n: SomeFloat): JSValue =
-  return JS_NewFloat64(ctx, float64(n))
+proc toJS*(ctx: JSContext, n: float64): JSValue =
+  return JS_NewFloat64(ctx, n)
 
 proc toJS*(ctx: JSContext, b: bool): JSValue =
   return JS_NewBool(ctx, b)