diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-11 18:25:46 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-11 18:25:46 +0100 |
commit | aeb9b9e5dddf3102773aa900865fe11a91cd65a6 (patch) | |
tree | ebd82f907877ea9caf3826f5ce993772e714d36c /src/js/tojs.nim | |
parent | 14c9c373a89ddd2c64d4178877db168253ff776d (diff) | |
download | chawan-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.nim | 12 |
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) |