Repository navigation
feat: instantiate script bindings before evaluation - #14
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
varand function declarations with their prescribed attributes, and initializes hoisted functions with ownname,length, andprototypeproperties. 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, andtest/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-cccompile/run pipeline throughcompile-stringandrun-compiledwas not run.Source and test line limits were checked locally. Linux CI runs the
treefmtformatting gate. I found nomaxFileLengthcheck in this repository's workflow or flake.