1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

LibWeb/WebIDL: Implement the wait for all AO

This abstract operation takes a list of IDL promises and chains them
together with .then() until all are completed or rejected.
This commit is contained in:
Andrew Kaster 2023-09-22 18:16:14 -06:00 committed by Alexander Kalenik
parent b07badb832
commit a5e05c5082
2 changed files with 87 additions and 0 deletions

View file

@ -29,5 +29,6 @@ JS::NonnullGCPtr<JS::Promise> react_to_promise(Promise const&, Optional<Reaction
JS::NonnullGCPtr<JS::Promise> upon_fulfillment(Promise const&, ReactionSteps);
JS::NonnullGCPtr<JS::Promise> upon_rejection(Promise const&, ReactionSteps);
void mark_promise_as_handled(Promise const&);
void wait_for_all(JS::Realm&, JS::MarkedVector<JS::NonnullGCPtr<Promise>> const& promises, JS::SafeFunction<void(JS::MarkedVector<JS::Value> const&)> success_steps, JS::SafeFunction<void(JS::Value)> failure_steps);
}