mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-18 00:52:57 +00:00
LibJS: Write computed function default arguments into the call frame
Previously, default argument values would only show up when accessing the argument by parameter name. This patch makes us write them back into the call frame so they can be accessed via VM::argument() as well.
This commit is contained in:
parent
481cef59b6
commit
a733a30373
Notes:
sideshowbarker
2024-07-18 12:15:59 +09:00
Author: https://github.com/awesomekling
Commit: a733a30373
1 changed files with 3 additions and 0 deletions
|
@ -144,6 +144,9 @@ Value ScriptFunction::execute_function_body()
|
|||
argument_value = js_undefined();
|
||||
}
|
||||
|
||||
if (i >= call_frame_args.size())
|
||||
call_frame_args.resize(i + 1);
|
||||
call_frame_args[i] = argument_value;
|
||||
vm.assign(param, argument_value, global_object(), true, vm.current_scope());
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue