Skip to content

Commit

Permalink
Editorial: rename ~awaiting-return~ state to ~draining-queue~
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Aug 10, 2024
1 parent 4cb5a69 commit f439ecc
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -48315,7 +48315,7 @@ <h1>%AsyncGeneratorPrototype%.next ( _value_ )</h1>
1. If _state_ is either ~suspended-start~ or ~suspended-yield~, then
1. Perform AsyncGeneratorResume(_generator_, _completion_).
1. Else,
1. Assert: _state_ is either ~executing~ or ~awaiting-return~.
1. Assert: _state_ is either ~executing~ or ~draining-queue~.
1. Return _promiseCapability_.[[Promise]].
</emu-alg>
</emu-clause>
Expand All @@ -48331,12 +48331,12 @@ <h1>%AsyncGeneratorPrototype%.return ( _value_ )</h1>
1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_).
1. Let _state_ be _generator_.[[AsyncGeneratorState]].
1. If _state_ is either ~suspended-start~ or ~completed~, then
1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~.
1. Set _generator_.[[AsyncGeneratorState]] to ~draining-queue~.
1. Perform AsyncGeneratorAwaitReturn(_generator_).
1. Else if _state_ is ~suspended-yield~, then
1. Perform AsyncGeneratorResume(_generator_, _completion_).
1. Else,
1. Assert: _state_ is either ~executing~ or ~awaiting-return~.
1. Assert: _state_ is either ~executing~ or ~draining-queue~.
1. Return _promiseCapability_.[[Promise]].
</emu-alg>
</emu-clause>
Expand All @@ -48360,7 +48360,7 @@ <h1>%AsyncGeneratorPrototype%.throw ( _exception_ )</h1>
1. If _state_ is ~suspended-yield~, then
1. Perform AsyncGeneratorResume(_generator_, _completion_).
1. Else,
1. Assert: _state_ is either ~executing~ or ~awaiting-return~.
1. Assert: _state_ is either ~executing~ or ~draining-queue~.
1. Return _promiseCapability_.[[Promise]].
</emu-alg>
</emu-clause>
Expand All @@ -48386,7 +48386,7 @@ <h1>Properties of AsyncGenerator Instances</h1>
</thead>
<tr>
<td>[[AsyncGeneratorState]]</td>
<td>*undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~awaiting-return~, or ~completed~</td>
<td>*undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~draining-queue~, or ~completed~</td>
<td>The current execution state of the async generator.</td>
</tr>
<tr>
Expand All @@ -48397,7 +48397,7 @@ <h1>Properties of AsyncGenerator Instances</h1>
<tr>
<td>[[AsyncGeneratorQueue]]</td>
<td>a List of AsyncGeneratorRequest Records</td>
<td>Records which represent requests to resume the async generator. Except during state transitions, it is non-empty if and only if [[AsyncGeneratorState]] is either ~executing~ or ~awaiting-return~.</td>
<td>Records which represent requests to resume the async generator. Except during state transitions, it is non-empty if and only if [[AsyncGeneratorState]] is either ~executing~ or ~draining-queue~.</td>
</tr>
<tr>
<td>[[GeneratorBrand]]</td>
Expand Down Expand Up @@ -48461,7 +48461,7 @@ <h1>
1. Let _result_ be Completion(_generatorBody_()).
1. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return.
1. Remove _acGenContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
1. Set _acGenerator_.[[AsyncGeneratorState]] to ~awaiting-return~.
1. Set _acGenerator_.[[AsyncGeneratorState]] to ~draining-queue~.
1. If _result_ is a normal completion, set _result_ to NormalCompletion(*undefined*).
1. If _result_ is a return completion, set _result_ to NormalCompletion(_result_.[[Value]]).
1. Perform AsyncGeneratorCompleteStep(_acGenerator_, _result_, *true*).
Expand Down Expand Up @@ -48626,7 +48626,7 @@ <h1>
<dl class="header">
</dl>
<emu-alg>
1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~.
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]].
1. Assert: _queue_ is not empty.
1. Let _next_ be the first element of _queue_.
Expand All @@ -48640,14 +48640,14 @@ <h1>
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. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~.
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
1. Let _result_ be NormalCompletion(_value_).
1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*).
1. Perform AsyncGeneratorDrainQueue(_generator_).
1. Return *undefined*.
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »).
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _generator_ and performs the following steps when called:
1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~.
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
1. Let _result_ be ThrowCompletion(_reason_).
1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*).
1. Perform AsyncGeneratorDrainQueue(_generator_).
Expand All @@ -48669,7 +48669,7 @@ <h1>
<dd>It drains the generator's AsyncGeneratorQueue until it encounters an AsyncGeneratorRequest which holds a return completion.</dd>
</dl>
<emu-alg>
1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~.
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~.
Expand Down

0 comments on commit f439ecc

Please sign in to comment.