Skip to content

Commit d063694

Browse files
committed
Editorial: simplify AsyncGeneratorDrainQueue
1 parent 815aa8a commit d063694

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

spec.html

+5-10
Original file line numberDiff line numberDiff line change
@@ -48676,24 +48676,19 @@ <h1>
4867648676
<emu-alg>
4867748677
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
4867848678
1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]].
48679-
1. If _queue_ is empty, then
48680-
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
48681-
1. Return ~unused~.
48682-
1. Let _done_ be *false*.
48683-
1. Repeat, while _done_ is *false*,
48679+
1. Repeat,
48680+
1. If _queue_ is empty, then
48681+
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
48682+
1. Return ~unused~.
4868448683
1. Let _next_ be the first element of _queue_.
4868548684
1. Let _completion_ be Completion(_next_.[[Completion]]).
4868648685
1. If _completion_ is a return completion, then
4868748686
1. Perform AsyncGeneratorAwaitReturn(_generator_).
48688-
1. Set _done_ to *true*.
48687+
1. Return ~unused~.
4868948688
1. Else,
4869048689
1. If _completion_ is a normal completion, then
4869148690
1. Set _completion_ to NormalCompletion(*undefined*).
4869248691
1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *true*).
48693-
1. If _queue_ is empty, then
48694-
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
48695-
1. Set _done_ to *true*.
48696-
1. Return ~unused~.
4869748692
</emu-alg>
4869848693
</emu-clause>
4869948694

0 commit comments

Comments
 (0)