1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibJS: Move has_simple_parameter_list to ECMAScriptFunctionObject

This commit is contained in:
Linus Groh 2021-09-25 00:10:09 +02:00
parent 76eb8fe717
commit a08292d76c
4 changed files with 7 additions and 9 deletions

View file

@ -374,7 +374,7 @@ Value VM::get_variable(const FlyString& name, GlobalObject& global_object)
if (possible_match.has_value())
return possible_match.value().value;
if (!context.arguments_object) {
if (context.function->is_strict_mode() || !context.function->has_simple_parameter_list()) {
if (context.function->is_strict_mode() || (is<ECMAScriptFunctionObject>(context.function) && !static_cast<ECMAScriptFunctionObject*>(context.function)->has_simple_parameter_list())) {
context.arguments_object = create_unmapped_arguments_object(global_object, context.arguments.span());
} else {
context.arguments_object = create_mapped_arguments_object(global_object, *context.function, verify_cast<ECMAScriptFunctionObject>(context.function)->formal_parameters(), context.arguments.span(), *lexical_environment());