about summary refs log tree commit diff stats
path: root/src/js/fromjs.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-12 12:42:15 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-12 12:45:49 +0200
commit53079a080291889428071700f8c0919f84132534 (patch)
tree95cfcde7ed6a043ac3d0f38e7ad789ee074fb19d /src/js/fromjs.nim
parent911ec9a85fc7b773fcea4b005d926702020a551f (diff)
downloadchawan-53079a080291889428071700f8c0919f84132534.tar.gz
js: allow var instead of ptr
Diffstat (limited to 'src/js/fromjs.nim')
-rw-r--r--src/js/fromjs.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/js/fromjs.nim b/src/js/fromjs.nim
index ccf8abcb..055ae19e 100644
--- a/src/js/fromjs.nim
+++ b/src/js/fromjs.nim
@@ -98,6 +98,9 @@ func fromJSInt[T: SomeInteger](ctx: JSContext; val: JSValue):
     if JS_ToUint32(ctx, addr ret, val) < 0:
       return err()
     return ok(ret)
+  else:
+    static:
+      error($T & " cannot be converted to JS automatically")
 
 proc fromJSFloat64(ctx: JSContext; val: JSValue): JSResult[float64] =
   var f64: float64