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

View File

@@ -1,61 +1,45 @@
{
"totals": {
"pass": 80,
"fail": 11,
"skip": 1,
"timeout": 8,
"total": 100,
"runnable": 99,
"pass_rate": 80.8
"pass": 44,
"fail": 3,
"skip": 0,
"timeout": 3,
"total": 50,
"runnable": 50,
"pass_rate": 88.0
},
"categories": [
{
"category": "built-ins/String",
"total": 100,
"pass": 80,
"fail": 11,
"skip": 1,
"timeout": 8,
"pass_rate": 80.8,
"category": "built-ins/Number",
"total": 50,
"pass": 44,
"fail": 3,
"skip": 0,
"timeout": 3,
"pass_rate": 88.0,
"top_failures": [
[
"Test262Error (assertion failed)",
9
],
[
"Timeout",
8
3
],
[
"ReferenceError (undefined symbol)",
1
],
[
"SyntaxError (parse/unsupported syntax)",
1
"Test262Error (assertion failed)",
3
]
]
}
],
"top_failure_modes": [
[
"Test262Error (assertion failed)",
9
],
[
"Timeout",
8
3
],
[
"ReferenceError (undefined symbol)",
1
],
[
"SyntaxError (parse/unsupported syntax)",
1
"Test262Error (assertion failed)",
3
]
],
"pinned_commit": "d5e73fc8d2c663554fb72e2380a8c2bc1a318a33",
"elapsed_seconds": 507.4,
"elapsed_seconds": 110.0,
"workers": 1
}

View File

@@ -1,28 +1,24 @@
# test262 scoreboard
Pinned commit: `d5e73fc8d2c663554fb72e2380a8c2bc1a318a33`
Wall time: 507.4s
Wall time: 110.0s
**Total:** 80/99 runnable passed (80.8%). Raw: pass=80 fail=11 skip=1 timeout=8 total=100.
**Total:** 44/50 runnable passed (88.0%). Raw: pass=44 fail=3 skip=0 timeout=3 total=50.
## Top failure modes
- **9x** Test262Error (assertion failed)
- **8x** Timeout
- **1x** ReferenceError (undefined symbol)
- **1x** SyntaxError (parse/unsupported syntax)
- **3x** Timeout
- **3x** Test262Error (assertion failed)
## Categories (worst pass-rate first, min 10 runnable)
| Category | Pass | Fail | Skip | Timeout | Total | Pass % |
|---|---:|---:|---:|---:|---:|---:|
| built-ins/String | 80 | 11 | 1 | 8 | 100 | 80.8% |
| built-ins/Number | 44 | 3 | 0 | 3 | 50 | 88.0% |
## Per-category top failures (min 10 runnable, worst first)
### built-ins/String (80/99 — 80.8%)
### built-ins/Number (44/50 — 88.0%)
- **9x** Test262Error (assertion failed)
- **8x** Timeout
- **1x** ReferenceError (undefined symbol)
- **1x** SyntaxError (parse/unsupported syntax)
- **3x** Timeout
- **3x** Test262Error (assertion failed)

View File

@@ -158,6 +158,8 @@ Each item: implement → tests → update progress. Mark `[x]` when tests green.
Append-only record of completed iterations. Loop writes one line per iteration: date, what was done, test count delta.
- 2026-05-08 — **`Boolean(NaN) === false` (and `!NaN === true`).** `js-to-boolean` was returning `true` for NaN because NaN ≠ 0 by IEEE semantics, so the `(= v 0)` test fell through to the truthy-else clause. 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.
- 2026-05-08 — **Global `eval(src)` actually evaluates the source.** Was returning the input string unchanged: `eval('1+2')` returned `"1+2"`, not `3`. Per spec, `eval(string)` parses and evaluates as JS; non-string input passes through. Wired the runtime stub through `js-eval` (which already does the lex/parse/transpile/eval pipeline) when the arg is a string. Fixes `String(eval('var x'))`, the harness internal `eval(...)`, and any test that calls `eval` for runtime evaluation. built-ins/String fail count: 13 → 11. conformance.sh: 148/148.
- 2026-05-08 — **`new <non-callable>` throws TypeError instead of hanging.** `new (new Object(""))` (calling `new` on a String wrapper dict) hung because `js-new-call` called `js-get-ctor-proto` which fell through to `js-ctor-id` which called `inspect ctor` — and `inspect` on a wrapper-with-proto-chain recurses through the prototype's lambdas forever. Added a `(js-function? ctor)` precheck at the top of `js-new-call`: when the receiver isn't callable, raise a `TypeError` instance instead. Now `try { new x } catch(e) { e instanceof TypeError }` returns `true` for non-callable `x`. conformance.sh: 148/148. String 80/99, Array 23/45 maintained.