mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 08:35:09 +00:00
LibJS: Don't extend arguments
object to match the parameter count
The `arguments` object should only have the *arguments* as numeric properties, not the *parameters*. Given this function: function foo(a, b) { return arguments.length; } Calling foo() with no arguments now correctly returns 0 instead of 2.
This commit is contained in:
parent
beb43f673e
commit
f61a9f2dc5
1 changed files with 0 additions and 3 deletions
|
@ -170,9 +170,6 @@ Value ScriptFunction::execute_function_body()
|
|||
argument_value = js_undefined();
|
||||
}
|
||||
|
||||
if (i >= execution_context_arguments.size())
|
||||
execution_context_arguments.resize(i + 1);
|
||||
execution_context_arguments[i] = argument_value;
|
||||
vm.assign(param, argument_value, global_object(), true, vm.lexical_environment());
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue