mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Update AST to use completions :^)
This is another major milestone on our journey towards removing global VM exception state :^) Does pretty much exactly what it says on the tin: updating ASTNode::execute() to return a Completion instead of a plain value. This will *also* allow us to eventually remove the non-standard unwinding mechanism and purely rely on the various completion types.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 21:44:39 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/da856d77423 Pull-request: https://github.com/SerenityOS/serenity/pull/11513 Reviewed-by: https://github.com/davidot ✅
@@ -54,9 +54,7 @@ ThrowCompletionOr<Object*> AsyncGeneratorFunctionConstructor::construct(Function
|
||||
}
|
||||
|
||||
VM::InterpreterExecutionScope scope(*interpreter);
|
||||
auto result = function->execute(*interpreter, global_object());
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto result = TRY(function->execute(*interpreter, global_object())).release_value();
|
||||
VERIFY(result.is_object() && is<ECMAScriptFunctionObject>(result.as_object()));
|
||||
return &result.as_object();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user