From 28473c9e9a44567642785901f6fe198968a99db9 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 21 Oct 2023 23:44:40 +0200 Subject: fromJSInt: do not fail if not IsNumber to match standard behavior (e.g. accept null as int, etc) --- src/js/fromjs.nim | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/js/fromjs.nim') diff --git a/src/js/fromjs.nim b/src/js/fromjs.nim index 80fdc1cd..eb03af40 100644 --- a/src/js/fromjs.nim +++ b/src/js/fromjs.nim @@ -59,8 +59,6 @@ func fromJSString2(ctx: JSContext, val: JSValue): JSResult[JSString] = func fromJSInt[T: SomeInteger](ctx: JSContext, val: JSValue): JSResult[T] = - if not JS_IsNumber(val): - return err() when T is int: # Always int32, so we don't risk 32-bit only breakage. # If int64 is needed, specify it explicitly. -- cgit 1.4.1-2-gfad0