Skip to content

Commit 75f1523

Browse files
bakkotljharb
authored andcommitted
Editorial: simplify AsyncGeneratorDrainQueue (#3411)
1 parent 7ff54a8 commit 75f1523

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

spec.html

+3-9
Original file line numberDiff line numberDiff line change
@@ -49322,23 +49322,17 @@ <h1>
4932249322
<emu-alg>
4932349323
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
4932449324
1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]].
49325-
1. If _queue_ is empty, then
49326-
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
49327-
1. Return ~unused~.
49328-
1. Let _done_ be *false*.
49329-
1. Repeat, while _done_ is *false*,
49325+
1. Repeat, while _queue_ is not empty,
4933049326
1. Let _next_ be the first element of _queue_.
4933149327
1. Let _completion_ be Completion(_next_.[[Completion]]).
4933249328
1. If _completion_ is a return completion, then
4933349329
1. Perform AsyncGeneratorAwaitReturn(_generator_).
49334-
1. Set _done_ to *true*.
49330+
1. Return ~unused~.
4933549331
1. Else,
4933649332
1. If _completion_ is a normal completion, then
4933749333
1. Set _completion_ to NormalCompletion(*undefined*).
4933849334
1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *true*).
49339-
1. If _queue_ is empty, then
49340-
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
49341-
1. Set _done_ to *true*.
49335+
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
4934249336
1. Return ~unused~.
4934349337
</emu-alg>
4934449338
</emu-clause>

0 commit comments

Comments
 (0)