js-on-sx: hoist var across nested blocks; var-decls become set!
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s

JS var is function-scoped, but the transpiler only collected
top-level vars and re-emitted (define) everywhere; for-body var
shadowed the outer (un-hoisted) scope. Three-part fix:
1. js-collect-var-names recurses into js-block/js-for/js-while
   /js-do-while/js-if/js-try/js-switch/js-for-of-in;
2. var-kind decls emit (set! ...) instead of (define ...) since
   the binding is already created at function scope;
3. js-block uses js-transpile-stmt-list (no re-hoist) instead of
   js-transpile-stmts.
built-ins/Array: 17/45 → 18/45, String: 77/99 → 78/99.
conformance.sh: 148/148.
This commit is contained in:
2026-05-08 02:21:54 +00:00
parent 24a67fae97
commit 0df2b1c7b2
4 changed files with 93 additions and 56 deletions

View File

@@ -1,41 +1,37 @@
{
"totals": {
"pass": 17,
"fail": 21,
"skip": 5,
"timeout": 7,
"total": 50,
"runnable": 45,
"pass_rate": 37.8
"pass": 78,
"fail": 15,
"skip": 1,
"timeout": 6,
"total": 100,
"runnable": 99,
"pass_rate": 78.8
},
"categories": [
{
"category": "built-ins/Array",
"total": 50,
"pass": 17,
"fail": 21,
"skip": 5,
"timeout": 7,
"pass_rate": 37.8,
"category": "built-ins/String",
"total": 100,
"pass": 78,
"fail": 15,
"skip": 1,
"timeout": 6,
"pass_rate": 78.8,
"top_failures": [
[
"Test262Error (assertion failed)",
16
13
],
[
"Timeout",
7
],
[
"TypeError: not a function",
2
6
],
[
"ReferenceError (undefined symbol)",
2
1
],
[
"Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\\",
"SyntaxError (parse/unsupported syntax)",
1
]
]
@@ -44,26 +40,22 @@
"top_failure_modes": [
[
"Test262Error (assertion failed)",
16
13
],
[
"Timeout",
7
],
[
"TypeError: not a function",
2
6
],
[
"ReferenceError (undefined symbol)",
2
1
],
[
"Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\\",
"SyntaxError (parse/unsupported syntax)",
1
]
],
"pinned_commit": "d5e73fc8d2c663554fb72e2380a8c2bc1a318a33",
"elapsed_seconds": 151.1,
"elapsed_seconds": 224.9,
"workers": 1
}