js-on-sx: Boolean(NaN) === false
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s
js-to-boolean was returning true for NaN because NaN != 0 by IEEE semantics — the (= v 0) test fell through to the truthy else. Per ES, NaN is one of the falsy values. Added a (js-number-is-nan v) clause. built-ins/Boolean: 19/27 → 21/27. conformance.sh: 148/148.
This commit is contained in:
@@ -1007,6 +1007,7 @@
|
||||
((= v nil) false)
|
||||
((= v false) false)
|
||||
((= v 0) false)
|
||||
((and (= (type-of v) "number") (js-number-is-nan v)) false)
|
||||
((= v "") false)
|
||||
(else true))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user