LibJS: Split the per-call-frame environment into lexical and variable

To better follow the spec, we need to distinguish between the current
execution context's lexical environment and variable environment.

This patch moves us to having two record pointers, although both of
them point at the same environment records for now.
This commit is contained in:
Andreas Kling 2021-06-22 15:42:44 +02:00
commit 1d20380859
Notes: sideshowbarker 2024-07-18 11:39:47 +09:00
13 changed files with 52 additions and 41 deletions

View file

@ -362,7 +362,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::eval)
}
auto& caller_frame = vm.call_stack().at(vm.call_stack().size() - 2);
TemporaryChange scope_change(vm.call_frame().environment_record, caller_frame->environment_record);
TemporaryChange scope_change(vm.call_frame().lexical_environment, caller_frame->lexical_environment);
auto& interpreter = vm.interpreter();
return interpreter.execute_statement(global_object, program).value_or(js_undefined());