about summary refs log tree commit diff stats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-31 13:54:44 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-31 13:54:44 +0100
commite9cc4edbb3695651b0abd7e33e40d942ad98ab2a (patch)
treea2a3a8d6ad9f165bcb2508b346e51e37f9abde83 /src/js
parent80b45c0df3f5bbbedb9abfb02fdef608113958e1 (diff)
downloadchawan-e9cc4edbb3695651b0abd7e33e40d942ad98ab2a.tar.gz
Remove non-existing JS type uint64
Oops.
Diffstat (limited to 'src/js')
-rw-r--r--src/js/javascript.nim11
1 files changed, 4 insertions, 7 deletions
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: