Skip to content

Commit

Permalink
Editorial: simplify AsyncGeneratorDrainQueue (#3411)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot authored and ljharb committed Feb 18, 2025
1 parent 7ff54a8 commit 75f1523
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -49322,23 +49322,17 @@ <h1>
<emu-alg>
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]].
1. If _queue_ is empty, then
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
1. Return ~unused~.
1. Let _done_ be *false*.
1. Repeat, while _done_ is *false*,
1. Repeat, while _queue_ is not empty,
1. Let _next_ be the first element of _queue_.
1. Let _completion_ be Completion(_next_.[[Completion]]).
1. If _completion_ is a return completion, then
1. Perform AsyncGeneratorAwaitReturn(_generator_).
1. Set _done_ to *true*.
1. Return ~unused~.
1. Else,
1. If _completion_ is a normal completion, then
1. Set _completion_ to NormalCompletion(*undefined*).
1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *true*).
1. If _queue_ is empty, then
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
1. Set _done_ to *true*.
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
1. Return ~unused~.
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 75f1523

Please # to comment.