mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
LibJS: Rename needs_argument_object to arguments_object_needed
- It's an "arguments object", not "argument object" - This is what the spec calls it (argumentsObjectNeeded)
This commit is contained in:
parent
3115a5306d
commit
3ab22c8012
1 changed files with 6 additions and 6 deletions
|
@ -159,9 +159,9 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
auto needs_argument_object = this_mode() != ThisMode::Lexical;
|
auto arguments_object_needed = this_mode() != ThisMode::Lexical;
|
||||||
if (parameter_names.contains(vm.names.arguments.as_string()))
|
if (parameter_names.contains(vm.names.arguments.as_string()))
|
||||||
needs_argument_object = false;
|
arguments_object_needed = false;
|
||||||
|
|
||||||
HashTable<FlyString> function_names;
|
HashTable<FlyString> function_names;
|
||||||
Vector<FunctionDeclaration const&> functions_to_initialize;
|
Vector<FunctionDeclaration const&> functions_to_initialize;
|
||||||
|
@ -175,12 +175,12 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||||
auto arguments_name = vm.names.arguments.as_string();
|
auto arguments_name = vm.names.arguments.as_string();
|
||||||
|
|
||||||
if (!has_parameter_expressions && function_names.contains(arguments_name))
|
if (!has_parameter_expressions && function_names.contains(arguments_name))
|
||||||
needs_argument_object = false;
|
arguments_object_needed = false;
|
||||||
|
|
||||||
if (!has_parameter_expressions && needs_argument_object) {
|
if (!has_parameter_expressions && arguments_object_needed) {
|
||||||
scope_body->for_each_lexically_declared_name([&](auto const& name) {
|
scope_body->for_each_lexically_declared_name([&](auto const& name) {
|
||||||
if (name == arguments_name)
|
if (name == arguments_name)
|
||||||
needs_argument_object = false;
|
arguments_object_needed = false;
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||||
VERIFY(!vm.exception());
|
VERIFY(!vm.exception());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needs_argument_object) {
|
if (arguments_object_needed) {
|
||||||
Object* arguments_object;
|
Object* arguments_object;
|
||||||
if (is_strict_mode() || !has_simple_parameter_list())
|
if (is_strict_mode() || !has_simple_parameter_list())
|
||||||
arguments_object = create_unmapped_arguments_object(global_object(), vm.running_execution_context().arguments);
|
arguments_object = create_unmapped_arguments_object(global_object(), vm.running_execution_context().arguments);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue