summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Interpreter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
index 9ac95b6339..3dfb8c509c 100644
--- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
@@ -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;