From e9faaa18253f2d6dc063f4cb3c4cf481e8f4f849 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Mon, 2 Sep 2019 23:16:14 -0500 Subject: [PATCH] Editorial: remove context copy from AsyncFunctionStart (#1685) --- spec.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index c4642ee5dd..b848cf3430 100644 --- a/spec.html +++ b/spec.html @@ -40123,8 +40123,7 @@

Async Functions Abstract Operations

AsyncFunctionStart ( _promiseCapability_, _asyncFunctionBody_ )

- 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. @@ -40139,7 +40138,9 @@

AsyncFunctionStart ( _promiseCapability_, _asyncFunctionBody_ )

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 Function [[Call]]. 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.