From 53079a080291889428071700f8c0919f84132534 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 12 May 2024 12:42:15 +0200 Subject: js: allow var instead of ptr --- src/js/fromjs.nim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/js/fromjs.nim') 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 -- cgit 1.4.1-2-gfad0