Repository navigation
Description
Parents: #465, #790. Observed while validating #794; independent of its capture change.
Implemented by e0ed6eb1. Local verification and pushed CI are complete.
At main 8d772d1, all five pinned Test262 generator/async-generator eval-var-scope-syntax-err.js variants fail identically before and after the nested-capture change. They expect SyntaxError from parameter initialization, but receive ReferenceError:
function* f(a = eval("var a = 42")) {}
assert.throws(SyntaxError, function () { f(); });Affected paths:
test/language/statements/generators/eval-var-scope-syntax-err.jstest/language/expressions/generators/eval-var-scope-syntax-err.jstest/language/statements/async-generator/eval-var-scope-syntax-err.jstest/language/expressions/async-generator/eval-var-scope-syntax-err.jstest/language/expressions/async-generator/named-eval-var-scope-syntax-err.jstest/language/expressions/object/method-definition/gen-meth-eval-var-scope-syntax-err.jstest/language/expressions/object/method-definition/async-gen-meth-eval-var-scope-syntax-err.js
The existing Interpreter.checkEvalLexicalConflicts uses cur_func_params during a parameter default to reject colliding eval var declarations. Ordinary calls install the callee's parameter metadata, but vm.makeGenerator and makeAsyncGenerator bind parameters without installing that metadata. This makes the conflict check depend on the caller's parameters and lets execution reach the parameter TDZ instead of rejecting the eval declaration.
Acceptance:
- Install and restore exact callee parameter metadata for suspendable parameter initialization, including abrupt exits and nested calls.
- All seven existing failures flip, with paired forced-tree-walker/required-bytecode evidence and unchanged adjacent parameter/eval cases.
- Cover caller/callee name collisions, destructuring/defaults, and restoration after an exception.
- Audit the other parameter-initialization context fields without changing native job/queue/lifecycle mechanisms or masking errors.
- Focused safety and full integration checks pass.
- Pushed CI passes before closing.
No implementation is included in the #794 capture change. The pinned corpus revision is 4249661388e5d3f92a85186213da140a6481490f.
The current audit also found pre-existing private-name and field-initializer context defects, tracked separately with exact before/after probes in #797. The #795 fix does not claim those behaviors are corrected.
Completed integration
CI run 33113309062 completed successfully on main commit 8a1398ffc04e9e30987f968693667c7271ca3ce1, which contains this fix. All 53 executed jobs succeeded, including all four unit and TSan-unit shards, Linux no-GIL TSan, functional/no-GIL corpus gates, fuzz profiles, ABI, Wasm, Test262 parallel, and docs. The scheduled-only nightly job was skipped, not counted as a pass. The local evidence above plus this descendant integration run completes this issue's acceptance.
Activity
fix(gc): distinguish generator tracing from resume ownership (#796)
feat(vm): capture frame bindings in suspendable closures (#794)
chrisbbreuer commentedon Aug 27, 2026
The local fix now flips seven pinned Test262 cases, including the two object-method variants outside the original five-path list.
Measured against main e1afde2 on pinned corpus 4249661388e5d3f92a85186213da140a6481490f:
The shared BindingInitialization helper now installs/restores callee formal metadata across the whole operation; all four function-aware entry points use callee strictness. Function-body entry clears inherited parameter-expression flags. No queue/job/lifecycle mechanism changed. Focused debug regressions and the allocation-failure replay pass (2/2); full integration and sanitizer verification remain pending. No commit has landed yet.
fix(eval): isolate callee parameter initialization (#795)
chrisbbreuer commentedon Aug 27, 2026
Landed directly on main as e0ed6eb1, authored and committed as Chris with no trailers.
Final local verification:
Audit follow-up #797 remains open for private-name/field-initializer context. No native stack, queue, job, Promise/Worker lifecycle, or Map/Set iterator mechanism was changed.
Evidence retained locally in /tmp/zig-js-795-params.qYytM4 (README maps final vs historical diagnostics). Temporary corpus files and obsolete owned binaries were cleaned up. Pushed CI is pending; leaving this issue open until that gate is verified.
fix(eval): retain lexical private contexts across suspension (#797)
chrisbbreuer commentedon Aug 27, 2026
Landed #797 in 8a1398ff — fix(eval): retain lexical private contexts across suspension (#797), directly on
origin/mainas Chris, without trailers.This completes the private-name/field-initializer context follow-up discovered during #795: exact lexical capture for ordinary and suspendable functions, correct nested-class shadowing, parameter/resume context restoration, early rejection of unknown private names, and indirect-eval/dynamic-constructor isolation. Existing native stack, queue, job, and root ownership is reused unchanged; #791 remains separate.
Measured evidence: 24 paired-mode witnesses improve 5 -> 24 pass; all 18 measured Test262 diagnostic subtrees are unchanged (12,075 pass / 2 existing fail, zero flips or regressions in this scope). The 9,643 eligible positive paired corpus files retain 8,475 passes and the identical 1,168 existing required-bytecode failures. Full units: 2,017 pass, 1 skip, 0 fail/leak. ReleaseSafe + TSan passes private 4/4, parameter 47/47, generator 45/45 (overlap); 400 default + 300 verify seeded fuzz programs pass. The GC witness proves actual receiver relocation.
#797 has updated local acceptance and remains open for pending required CI. Evidence:
/tmp/zig-js-797-context.2QwDxk/README.md. This does not claim the parent VM-admission goal is complete.