js-on-sx: Boolean(NaN) === false
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:
2026-05-08 09:19:21 +00:00
parent 7a898567e4
commit 082749f0a9
4 changed files with 32 additions and 49 deletions

View File

@@ -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))))