about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/quickjs.nim1
-rw-r--r--src/js/javascript.nim11
2 files changed, 4 insertions, 8 deletions
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim
index 6dbc1f2d..2d37a789 100644
--- a/src/bindings/quickjs.nim
+++ b/src/bindings/quickjs.nim
@@ -331,7 +331,6 @@ proc JS_NewInt32*(ctx: JSContext, val: int32): JSValue
 proc JS_NewCatchOffset*(ctx: JSContext, val: int32): JSValue
 proc JS_NewInt64*(ctx: JSContext, val: int64): JSValue
 proc JS_NewUint32*(ctx: JSContext, val: uint32): JSValue
-proc JS_NewUint64*(ctx: JSContext, val: uint64): JSValue
 proc JS_NewBigInt64*(ctx: JSContext, val: int64): JSValue
 proc JS_NewBigUInt64*(ctx: JSContext, val: uint64): JSValue
 proc JS_NewFloat64*(ctx: JSContext, val: cdouble): JSValue
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index 56746a53..63700536 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -679,19 +679,16 @@ func toJSInt(ctx: JSContext, n: SomeInteger): JSValue =
       return JS_NewInt32(ctx, int32(n))
     else:
       return JS_NewInt64(ctx, n)
-  elif n is uint:
-    when sizeof(uint) <= sizeof(uint32):
-      return JS_NewUint32(ctx, n)
-    else:
-      return JS_NewUint64(ctx, n)
+  elif n is uint32:
+    return JS_NewUint32(ctx, n)
   elif n is int32:
     return JS_NewInt32(ctx, n)
   elif n is int64:
     return JS_NewInt64(ctx, n)
   elif n is uint32:
     return JS_NewUint32(ctx, n)
-  elif n is uint64:
-    return JS_NewUint64(ctx, n)
+  else:
+    error("Unsupported numeric type")
 
 func toJSNumber(ctx: JSContext, n: SomeNumber): JSValue =
   when n is SomeInteger: