mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibJS: Always init arguments stored in locals for generator functions
Since AST interpreter switches to bytecode to execute generator functions, arguments stored in local variables always need to be initialized for such functions.
This commit is contained in:
parent
e5b70837de
commit
71c54dd37b
Notes:
sideshowbarker
2024-07-17 06:35:16 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/71c54dd37b Pull-request: https://github.com/SerenityOS/serenity/pull/19869
1 changed files with 1 additions and 1 deletions
|
@ -479,7 +479,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||||
Environment* used_environment = has_duplicates ? nullptr : environment;
|
Environment* used_environment = has_duplicates ? nullptr : environment;
|
||||||
|
|
||||||
if constexpr (IsSame<NonnullRefPtr<Identifier const> const&, decltype(param)>) {
|
if constexpr (IsSame<NonnullRefPtr<Identifier const> const&, decltype(param)>) {
|
||||||
if (vm.bytecode_interpreter_if_exists() && param->is_local()) {
|
if ((vm.bytecode_interpreter_if_exists() || kind() == FunctionKind::Generator) && param->is_local()) {
|
||||||
// NOTE: Local variables are supported only in bytecode interpreter
|
// NOTE: Local variables are supported only in bytecode interpreter
|
||||||
callee_context.local_variables[param->local_variable_index()] = argument_value;
|
callee_context.local_variables[param->local_variable_index()] = argument_value;
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in a new issue