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:
Andreas Kling 2021-06-14 09:33:10 +02:00
parent 481cef59b6
commit a733a30373
Notes: sideshowbarker 2024-07-18 12:15:59 +09:00

View file

@ -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());
});