mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibJS: Fix the execution context for the bytecode interpreter
Because we now push an execution context when creating the "normal" interpreter without valid environments we have to check for that case as well when running the bytecode interpreter.
This commit is contained in:
@@ -46,7 +46,8 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
|
||||
TemporaryChange restore_executable { m_current_executable, &executable };
|
||||
|
||||
ExecutionContext execution_context(vm().heap());
|
||||
if (vm().execution_context_stack().is_empty()) {
|
||||
if (vm().execution_context_stack().is_empty() || !vm().running_execution_context().lexical_environment) {
|
||||
// The "normal" interpreter pushes an execution context without environment so in that case we also want to push one.
|
||||
execution_context.this_value = &global_object();
|
||||
static FlyString global_execution_context_name = "(*BC* global execution context)";
|
||||
execution_context.function_name = global_execution_context_name;
|
||||
|
||||
Reference in New Issue
Block a user