Skip to content

Commit

Permalink
Editorial: Eliminate weird Return notes
Browse files Browse the repository at this point in the history
That is, eliminate NOTE-steps that tell you
where a Return-step returns to.

Resolves tc39#2400
by performing the transformation outlined in:
tc39#2400 (comment)
  • Loading branch information
jmdyck committed Feb 15, 2022
1 parent ca53334 commit bf74cca
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4005,9 +4005,10 @@ <h1>Await</h1>
1. Let _onRejected_ be ! CreateBuiltinFunction(_rejectedClosure_, 1, *""*, &laquo; &raquo;).
1. Perform ! PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_).
1. Remove _asyncContext_ 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 the code evaluation state of _asyncContext_ such that when evaluation is resumed with a Completion _completion_, the following steps of the algorithm that invoked Await will be performed, with _completion_ available.
1. Return.
1. NOTE: This returns to the evaluation of the operation that had most previously resumed evaluation of _asyncContext_.
1. Let _callerContext_ be the running execution context.
1. Resume _callerContext_ passing ~empty~. If _asyncContext_ is ever resumed again, let _completion_ be the value with which it is resumed.
1. Assert: If control reaches here, then _asyncContext_ is the running execution context again.
1. NOTE: The following steps of the algorithm that invoked Await will be performed, with _completion_ available.
</emu-alg>

<p>where all aliases in the above steps, with the exception of _completion_, are ephemeral and visible only in the steps pertaining to Await.</p>
Expand Down Expand Up @@ -44572,11 +44573,10 @@ <h1>
1. Assert: GetGeneratorKind() is ~sync~.
1. Set _generator_.[[GeneratorState]] to ~suspendedYield~.
1. Remove _genContext_ 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 the code evaluation state of _genContext_ such that when evaluation is resumed with a Completion _resumptionValue_ the following steps will be performed:
1. Return _resumptionValue_.
1. NOTE: This returns to the evaluation of the |YieldExpression| that originally called this abstract operation.
1. Return NormalCompletion(_iterNextObj_).
1. NOTE: This returns to the evaluation of the operation that had most previously resumed evaluation of _genContext_.
1. Let _callerContext_ be the running execution context.
1. Resume _callerContext_ passing NormalCompletion(_iterNextObj_). If _genContext_ is ever resumed again, let _resumptionValue_ be the value with which it is resumed.
1. Assert: If control reaches here, then _genContext_ is the running execution context again.
1. Return _resumptionValue_.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -44947,11 +44947,10 @@ <h1>
1. Else,
1. Set _generator_.[[AsyncGeneratorState]] to ~suspendedYield~.
1. Remove _genContext_ 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 the code evaluation state of _genContext_ such that when evaluation is resumed with a Completion _resumptionValue_ the following steps will be performed:
1. Return AsyncGeneratorUnwrapYieldResumption(_resumptionValue_).
1. NOTE: When the above step returns, it returns to the evaluation of the |YieldExpression| production that originally called this abstract operation.
1. Return *undefined*.
1. NOTE: This returns to the evaluation of the operation that had most previously resumed evaluation of _genContext_.
1. Let _callerContext_ be the running execution context.
1. Resume _callerContext_ passing *undefined*. If _genContext_ is ever resumed again, let _resumptionValue_ be the value with which it is resumed.
1. Assert: If control reaches here, then _genContext_ is the running execution context again.
1. Return AsyncGeneratorUnwrapYieldResumption(_resumptionValue_).
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit bf74cca

Please sign in to comment.