LibJS: Convert GeneratorObject to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-11-09 16:48:44 +02:00
parent 11a90700df
commit 91881be4b0
Notes: sideshowbarker 2024-07-18 01:21:51 +09:00
4 changed files with 16 additions and 25 deletions

View file

@ -688,7 +688,7 @@ Completion ECMAScriptFunctionObject::ordinary_call_evaluate_body()
if (m_kind != FunctionKind::Generator)
return { Completion::Type::Return, result.value_or(js_undefined()), {} };
return normal_completion(GeneratorObject::create(global_object(), result, this, vm.running_execution_context().lexical_environment, bytecode_interpreter->snapshot_frame()));
return normal_completion(TRY(GeneratorObject::create(global_object(), result, this, vm.running_execution_context().lexical_environment, bytecode_interpreter->snapshot_frame())));
} else {
if (m_kind != FunctionKind::Regular)
return vm.throw_completion<InternalError>(global_object(), ErrorType::NotImplemented, "Non regular function execution in AST interpreter");