Skip to content

Commit

Permalink
Normative: handle broken promises in AsyncGenerator.prototype.return (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot authored and ljharb committed Jun 26, 2024
1 parent 4e32b34 commit 6363c2d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -48562,7 +48562,14 @@ <h1>
1. Let _next_ be the first element of _queue_.
1. Let _completion_ be Completion(_next_.[[Completion]]).
1. Assert: _completion_ is a return completion.
1. Let _promise_ be ? PromiseResolve(%Promise%, _completion_.[[Value]]).
1. Let _promiseCompletion_ be Completion(PromiseResolve(%Promise%, _completion_.[[Value]])).
1. If _promiseCompletion_ is an abrupt completion, then
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
1. Perform AsyncGeneratorCompleteStep(_generator_, _promiseCompletion_, *true*).
1. Perform AsyncGeneratorDrainQueue(_generator_).
1. Return ~unused~.
1. Assert: _promiseCompletion_ is a normal completion.
1. Let _promise_ be _promiseCompletion_.[[Value]].
1. Let _fulfilledClosure_ be a new Abstract Closure with parameters (_value_) that captures _generator_ and performs the following steps when called:
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
1. Let _result_ be NormalCompletion(_value_).
Expand Down

0 comments on commit 6363c2d

Please sign in to comment.