diff --git a/spec.html b/spec.html index 09c62ca6cf..e4dee791ae 100644 --- a/spec.html +++ b/spec.html @@ -2990,22 +2990,21 @@

Await

Algorithm steps that say

- 1. Let _completion_ be Await(_promise_). + 1. Let _completion_ be Await(_value_).

mean the same thing as:

1. Let _asyncContext_ be the running execution context. - 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _promise_ »). + 1. Let _promise_ be ? PromiseResolve(%Promise%, « _value_ »). 1. Let _stepsFulfilled_ be the algorithm steps defined in . 1. Let _onFulfilled_ be CreateBuiltinFunction(_stepsFulfilled_, « [[AsyncContext]] »). 1. Set _onFulfilled_.[[AsyncContext]] to _asyncContext_. 1. Let _stepsRejected_ be the algorithm steps defined in . 1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, « [[AsyncContext]] »). 1. Set _onRejected_.[[AsyncContext]] to _asyncContext_. - 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_). + 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. @@ -3018,14 +3017,14 @@

Await

Await can be combined with the `?` and `!` prefixes, so that for example

- 1. Let _value_ be ? Await(_promise_). + 1. Let _result_ be ? Await(_value_).

means the same thing as:

- 1. Let _value_ be Await(_promise_). - 1. ReturnIfAbrupt(_value_). + 1. Let _result_ be Await(_value_). + 1. ReturnIfAbrupt(_result_). @@ -36901,7 +36900,7 @@

Properties of Async-from-Sync Iterator Instances

- +

AsyncFromSyncIteratorContinuation ( _result_, _promiseCapability_ )

@@ -36909,12 +36908,11 @@

AsyncFromSyncIteratorContinuation ( _result_, _promiseCapability_ )

1. IfAbruptRejectPromise(_done_, _promiseCapability_). 1. Let _value_ be IteratorValue(_result_). 1. IfAbruptRejectPromise(_value_, _promiseCapability_). - 1. Let _valueWrapperCapability_ be ! NewPromiseCapability(%Promise%). - 1. Perform ! Call(_valueWrapperCapability_.[[Resolve]], *undefined*, « _value_ »). + 1. Let _valueWrapper_ be ? PromiseResolve(%Promise%, « _value_ »). 1. Let _steps_ be the algorithm steps defined in . 1. Let _onFulfilled_ be CreateBuiltinFunction(_steps_, « [[Done]] »). 1. Set _onFulfilled_.[[Done]] to _done_. - 1. Perform ! PerformPromiseThen(_valueWrapperCapability_.[[Promise]], _onFulfilled_, *undefined*, _promiseCapability_). + 1. Perform ! PerformPromiseThen(_valueWrapper_, _onFulfilled_, *undefined*, _promiseCapability_). 1. Return _promiseCapability_.[[Promise]].
@@ -37535,15 +37533,14 @@

AsyncGeneratorResumeNext ( _generator_ )

1. If _state_ is `"completed"`, then 1. If _completion_.[[Type]] is ~return~, then 1. Set _generator_.[[AsyncGeneratorState]] to `"awaiting-return"`. - 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _completion_.[[Value]] »). + 1. Let _promise_ be ? PromiseResolve(%Promise%, « _completion_.[[Value]] »). 1. Let _stepsFulfilled_ be the algorithm steps defined in . 1. Let _onFulfilled_ be CreateBuiltinFunction(_stepsFulfilled_, « [[Generator]] »). 1. Set _onFulfilled_.[[Generator]] to _generator_. 1. Let _stepsRejected_ be the algorithm steps defined in . 1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, « [[Generator]] »). 1. Set _onRejected_.[[Generator]] to _generator_. - 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_). + 1. Perform ! PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_). 1. Return *undefined*. 1. Else, 1. Assert: _completion_.[[Type]] is ~throw~.