Files
scriptc/tests
Malte UblandClaude Opus 5.5 8aa69ad169 Stop checking the storage fill of early-reachable let globals
A top-level `let x;` in a JavaScript module holds a checked dynamic value
that the module %init fills with undefined at entry. When the module's
early-running code (a published function, a function declaration called
above the binding) can reach the binding, it also gets an initialization
flag, and every write before the flag is set is TDZ-checked. The entry
fill was rewritten like a source write, so the module threw "Cannot
access 'x' before initialization" before its first statement ran. That
broke json5, cliui and cosmiconfig on load.

Mark the fill as initializing when the global has a flag: it is storage
setup, not the source write, so it neither runs the check nor sets the
flag. Accesses that really happen before the declaration still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:04:20 -07:00
..
2026-10-18 12:28:02 -05:00
2026-10-18 12:01:19 -05:00