about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-21 23:44:40 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-21 23:45:57 +0200
commit28473c9e9a44567642785901f6fe198968a99db9 (patch)
tree94f22d429181124f25ba04a95722dd73f4b08552
parent8e49de968fded9d43230e03beaaa4f9bd59b5dea (diff)
downloadchawan-28473c9e9a44567642785901f6fe198968a99db9.tar.gz
fromJSInt: do not fail if not IsNumber
to match standard behavior (e.g. accept null as int, etc)
-rw-r--r--src/js/fromjs.nim2
-rw-r--r--todo1
2 files changed, 0 insertions, 3 deletions
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.
diff --git a/todo b/todo
index 98c56ea8..54fd58d0 100644
--- a/todo
+++ b/todo
@@ -59,7 +59,6 @@ javascript:
 	* more concretely: get jQuery to work. this needs innerHTML, CSS
 	  properties in DOM, ...
 - implement ReadableStream, XHR
-- new Intl.NumberFormat().format(null)
 - separate console for each buffer
 - buffer selection
 layout engine: