Skip to content

feat: instantiate script bindings before evaluation - #14

Merged
takeokunn merged 1 commit into
mainfrom
ctl/W4-03-pre-gdi
Oct 28, 2026
Merged

takeokunn merged 1 commit into
mainfrom
ctl/W4-03-pre-gdi

Conversation

@takeokunn

Copy link
Copy Markdown
Contributor

Behavior

This change runs GlobalDeclarationInstantiation (§16.1.7) before script evaluation. It checks top-level declaration conflicts, creates global lexical bindings and global-object properties for var and function declarations with their prescribed attributes, and initializes hoisted functions with own name, length, and prototype properties. See ECMA-262 §16.1.7.

Test262 references

The regression tests cite these upstream cases: test/language/global-code/decl-var.js, test/language/global-code/decl-func.js, test/language/global-code/script-decl-lex.js, test/language/global-code/script-decl-lex-var.js, test/language/global-code/script-decl-lex-restricted-global.js, test/language/statements/function/name.js, test/language/statements/function/length-dflt.js, and test/built-ins/Function/prototype/S15.3.5.2_A1_T1.js. The Test262 harness was not run.

Scope

Coverage is limited to script evaluation. Strict-mode GDI, direct eval, and modules are outside this change. The parent cl-cc compile/run pipeline through compile-string and run-compiled was not run.

Source and test line limits were checked locally. Linux CI runs the treefmt formatting gate. I found no maxFileLength check in this repository's workflow or flake.

@takeokunn
takeokunn marked this pull request as ready for review October 28, 2026 12:51
@takeokunn
takeokunn merged commit 0cddb00 into main Oct 28, 2026
1 check passed
@takeokunn
takeokunn deleted the ctl/W4-03-pre-gdi branch October 28, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant