Repository navigation
Conversation
…l do it The op's text now says what the handler does with the compiled eval code: the EvalDeclarationInstantiation checks and var bindings (§19.2.1.3 steps 3, 10, 12, 13 and 18) before the code runs, and the code's prologue instantiating the functions (step 17) into varEnv. Step numbers of PerformEval (§19.2.1.1) checked against the pinned ECMA-262 text; no op is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PerformEval (ECMA-262 §19.2.1.1) parses eval code as a Script, then makes new.target, super.x, super() and arguments early errors where the caller does not allow them (steps 11.e to 11.h) and strict where the caller is (step 12); EvalDeclarationInstantiation checks private names against the caller's classes (steps 4 to 7). exec::parse_eval runs the same parser and checks with early::check_in and an EvalContext; check and parse are the default context. Not part of the spec's early errors, so only tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The interpreter runs the ops the compiler already emitted for with and direct eval: WithHas, WithGet, WithSet and WithDelete (the Object Environment Record, §9.1.1.2), DeleteGlobal (§9.1.1.4.7), and DirectEval and DirectEvalSpread (§13.3.6.1 step 6), whose handler is PerformEval (§19.2.1.1). Vm::perform_eval is the indirect eval for %eval% (a new Intrinsic), and Vm::create_dynamic_function is CreateDynamicFunction (§20.2.1.1.1) for the Function constructors. The host compile path is compile::compile_eval: scope analysis puts the record's scopes of the caller around the eval code (scope::analyze_eval), so its names resolve as a nested function's do, and its this, new.target and super through the caller's bindings. The main function returns the completion value (§6.2.4.4 UpdateEmpty, per statement). The work of EvalDeclarationInstantiation (§19.2.1.3) is split as the op's text says: the compiler finds step 3.d's conflicts and lists the declarations, the handler checks and makes the varEnv bindings, the code's prologue stores the functions. A call in parameter expressions records the function's scope as a parameter scope (§10.2.11 step 20). compile_dynamic_function compiles the function of the source text CreateDynamicFunction built, which is parsed once and checked to be exactly that one declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The global eval is %eval% (§19.2.1), calling the VM's PerformEval; Function, GeneratorFunction, AsyncFunction and AsyncGeneratorFunction (§20.2.1.1, §27.3.1.1, §27.7.1.1, §27.4.1.1) call the VM's CreateDynamicFunction instead of throwing NotYet. tests/dynamic_code.rs runs direct and indirect eval, with, delete of a variable and the four constructors through the built-ins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the pinned commit: test/built-ins/eval, test/language/eval-code, test/language/statements/with and test/built-ins/Function, but one file whose lines end in CR alone, which the table's frontmatter reader does not read (SOURCE.md says so). The table is regenerated: 8,560 tests. conformance_builtins runs them: the four tests that were expected failures because eval was missing now run and pass; the Function tests that fail for the listed differences of %Function.prototype% (an ordinary object, without the caller and arguments accessors, without toString) are expected failures with those reasons; and the directories of code compiled at run time are counted each on its own. conformance_interp, which installs no built-ins, keeps its eval entries with their reason reworded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and classes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
had a problem deploying
to
full-verification
November 25, 2026 03:38 — with
GitHub Actions
Error
This branch was successfully deployed
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.
Phase 7, items 7.7 to 7.9: the dynamic-code parts of the engine.
eval(direct and indirect),with,deleteof a variable, and theFunction,GeneratorFunction,AsyncFunctionandAsyncGeneratorFunctionconstructors now run.It was cut from
claude/js-generators-async(#304, now merged), andmainis merged in.Commits of this PR
clazel-js-vm/src/ops.rs):DirectEval's text now says what its handler does with the compiled eval code. No op is added: the ops forwith,deleteand direct eval were already in the spec, with their proofs and certified mutations; only the handler op's prose changed (the EvalDeclarationInstantiation steps the handler does, the parameter scope of the record). PerformEval, EvalDeclarationInstantiation, the global environment's operations and CreateDynamicFunction were read at the pinned ECMA-262 commit, so those citations have no †.clazel-js-syntax:exec::parse_eval, a Script with its caller's early errors (PerformEval steps 11.e to 11.h and 12, and private names of the classes around the call).clazel-js-vm: the interpreter runsWithHas/WithGet/WithSet/WithDelete,DeleteGlobal,DirectEval/DirectEvalSpread;compile::compile_eval(scope analysis puts the caller's recorded scopes around the eval code; completion values; the EvalDeclarationInstantiation split between compiler, handler and the code's prologue);compile::compile_dynamic_function;Vm::perform_evalandVm::create_dynamic_function. Its differences from the standard are listed at the top ofsrc/eval.rsand incompile.rs's header.clazel-js-builtins: globalevalis%eval%; the four constructors call CreateDynamicFunction instead of throwing NotYet.built-ins/eval,language/eval-code,language/statements/withandbuilt-ins/Functionfrom the pinned commit (all but one CR-only file the table's reader cannot read; SOURCE.md says so).Test262 (conformance_builtins)
Whole suite: 3,984 pass, 4,576 expected failures, 0 failures of 8,560. The four tests that were expected failures because
evalwas missing now pass, and their entries are gone. The new expected failures inbuilt-ins/Functionare each listed with the reason:%Function.prototype%is an ordinary object (not callable, nocaller/argumentsaccessors, notoString), a difference the built-ins already listed.Not done
argumentsobject (CreateMappedArgumentsObject) is still unmapped: it needs an exotic object in the heap's property paths, not a small step from this work. Its two expected failures stay.Verification
cargo xtask verify --changed: see the comment below for its last line once it finishes. CI's full verification has not run yet; the proof jobs need a reviewer's approval.🤖 Generated with Claude Code