Skip to content

Commit

Permalink
Editorial: remove context copy from AsyncFunctionStart (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek authored and ljharb committed Oct 17, 2019
1 parent 712b03b commit e9faaa1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -40123,8 +40123,7 @@ <h1>Async Functions Abstract Operations</h1>
<emu-clause id="sec-async-functions-abstract-operations-async-function-start" aoid="AsyncFunctionStart">
<h1>AsyncFunctionStart ( _promiseCapability_, _asyncFunctionBody_ )</h1>
<emu-alg>
1. Let _runningContext_ be the running execution context.
1. Let _asyncContext_ be a copy of _runningContext_.
1. Let _asyncContext_ be the running execution context.
1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed for that execution context the following steps will be performed:
1. Let _result_ be the result of evaluating _asyncFunctionBody_.
1. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done.
Expand All @@ -40139,7 +40138,9 @@ <h1>AsyncFunctionStart ( _promiseCapability_, _asyncFunctionBody_ )</h1>
1. Return.
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
1. Resume the suspended evaluation of _asyncContext_. Let _result_ be the value returned by the resumed computation.
1. Assert: When we return here, _asyncContext_ has already been removed from the execution context stack and _runningContext_ is the currently running execution context.
1. Assert: When we return here, _asyncContext_ has been removed from the execution context stack.
1. Push _asyncContext_ onto the execution context stack.
1. NOTE: Pushing _asyncContext_ onto the execution context stack is needed to fulfill invariants of <emu-xref href="#sec-ecmascript-function-objects-call-thisargument-argumentslist">Function [[Call]]</a>.
1. Assert: _result_ is a normal completion with a value of *undefined*. The possible sources of completion values are Await or, if the async function doesn't await anything, the step 3.g above.
1. Return.
</emu-alg>
Expand Down

0 comments on commit e9faaa1

Please sign in to comment.