diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 2662943380..4a032b732f 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -358,7 +358,7 @@ Value VM::get_variable(const FlyString& name, GlobalObject& global_object) { if (!m_execution_context_stack.is_empty()) { auto& context = running_execution_context(); - if (name == names.arguments.as_string() && context.callee) { + if (name == names.arguments.as_string() && context.function) { // HACK: Special handling for the name "arguments": // If the name "arguments" is defined in the current scope, for example via // a function parameter, or by a local var declaration, we use that. @@ -369,7 +369,7 @@ Value VM::get_variable(const FlyString& name, GlobalObject& global_object) return possible_match.value().value; if (!context.arguments_object) { context.arguments_object = Array::create(global_object); - context.arguments_object->put(names.callee, context.callee); + context.arguments_object->put(names.callee, context.function); for (auto argument : context.arguments) { context.arguments_object->indexed_properties().append(argument); } @@ -405,7 +405,7 @@ Value VM::construct(Function& function, Function& new_target, Optionalcurrent_node(); execution_context.is_strict_mode = function.is_strict_mode(); @@ -511,7 +511,7 @@ Value VM::call_internal(Function& function, Value this_value, Optionalcurrent_node(); execution_context.is_strict_mode = function.is_strict_mode(); diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 4b568f7e65..b49d1468aa 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -45,7 +45,7 @@ struct ScopeFrame { struct ExecutionContext { const ASTNode* current_node { nullptr }; FlyString function_name; - Value callee; + Function* function { nullptr }; Value this_value; Vector arguments; Array* arguments_object { nullptr };