1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 07:04:59 +00:00

LibJS: Enable bytecode default parameter values for async generators

This commit is contained in:
Luke Wilde 2023-07-14 21:55:01 +01:00 committed by Linus Groh
parent 3373626dd5
commit d4e30710e7

View file

@ -461,7 +461,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
argument_value = execution_context_arguments[i];
} else if (parameter.default_value) {
auto* bytecode_interpreter = vm.bytecode_interpreter_if_exists();
if (static_cast<FunctionKind>(m_kind) == FunctionKind::Generator)
if (static_cast<FunctionKind>(m_kind) == FunctionKind::Generator || static_cast<FunctionKind>(m_kind) == FunctionKind::AsyncGenerator)
bytecode_interpreter = &vm.bytecode_interpreter();
if (bytecode_interpreter) {
auto value_and_frame = bytecode_interpreter->run_and_return_frame(realm, *m_default_parameter_bytecode_executables[default_parameter_index - 1], nullptr);