mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 09:48:47 +00:00
LibJS: Convert GeneratorObject to ThrowCompletionOr
This commit is contained in:
parent
11a90700df
commit
91881be4b0
Notes:
sideshowbarker
2024-07-18 01:21:51 +09:00
Author: https://github.com/IdanHo
Commit: 91881be4b0
Pull-request: https://github.com/SerenityOS/serenity/pull/10852
Reviewed-by: https://github.com/linusg ✅
4 changed files with 16 additions and 25 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue