mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-23 17:58:59 +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
Notes:
sideshowbarker
2024-07-18 11:28:19 +09:00
Author: https://github.com/awesomekling
Commit: f61a9f2dc5
1 changed files with 0 additions and 3 deletions
|
@ -170,9 +170,6 @@ Value ScriptFunction::execute_function_body()
|
||||||
argument_value = js_undefined();
|
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());
|
vm.assign(param, argument_value, global_object(), true, vm.lexical_environment());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue