Skip to content

Commit 9193d0c

Browse files
wrap AC return values in completion records where needed
1 parent 7af34ed commit 9193d0c

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

spec.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14723,7 +14723,7 @@ <h1>
1472314723
</dl>
1472414724
<emu-alg>
1472514725
1. Let _getterClosure_ be a new Abstract Closure with no parameters that captures _name_ and _env_ and performs the following steps when called:
14726-
1. Return ! _env_.GetBindingValue(_name_, *false*).
14726+
1. Return NormalCompletion(! _env_.GetBindingValue(_name_, *false*)).
1472714727
1. Let _getter_ be CreateBuiltinFunction(_getterClosure_, 0, *""*, « »).
1472814728
1. NOTE: _getter_ is never directly accessible to ECMAScript code.
1472914729
1. Return _getter_.
@@ -14743,7 +14743,7 @@ <h1>
1474314743
</dl>
1474414744
<emu-alg>
1474514745
1. Let _setterClosure_ be a new Abstract Closure with parameters (_value_) that captures _name_ and _env_ and performs the following steps when called:
14746-
1. Return ! _env_.SetMutableBinding(_name_, _value_, *false*).
14746+
1. Return NormalCompletion(! _env_.SetMutableBinding(_name_, _value_, *false*)).
1474714747
1. Let _setter_ be CreateBuiltinFunction(_setterClosure_, 1, *""*, « »).
1474814748
1. NOTE: _setter_ is never directly accessible to ECMAScript code.
1474914749
1. Return _setter_.
@@ -19863,18 +19863,18 @@ <h1>
1986319863
1. Let _loadPromise_ be _module_.LoadRequestedModules().
1986419864
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called:
1986519865
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »).
19866-
1. Return ~unused~.
19866+
1. Return NormalCompletion(*undefined*).
1986719867
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »).
1986819868
1. Let _linkAndEvaluateClosure_ be a new Abstract Closure with no parameters that captures _module_, _promiseCapability_, and _onRejected_ and performs the following steps when called:
1986919869
1. Let _link_ be Completion(_module_.Link()).
1987019870
1. If _link_ is an abrupt completion, then
1987119871
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _link_.[[Value]] »).
19872-
1. Return ~unused~.
19872+
1. Return NormalCompletion(*undefined*).
1987319873
1. Let _evaluatePromise_ be _module_.Evaluate().
1987419874
1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and _promiseCapability_ and performs the following steps when called:
1987519875
1. Let _namespace_ be GetModuleNamespace(_module_).
1987619876
1. Perform ! <emu-meta effects="user-code">Call</emu-meta>(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_ »).
19877-
1. Return ~unused~.
19877+
1. Return NormalCompletion(*undefined*).
1987819878
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »).
1987919879
1. Perform PerformPromiseThen(_evaluatePromise_, _onFulfilled_, _onRejected_).
1988019880
1. Return ~unused~.
@@ -25217,7 +25217,7 @@ <h1>
2521725217
1. NOTE: This branch behaves similarly to `constructor() {}`.
2521825218
1. Let _result_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Object.prototype%"*).
2521925219
1. Perform ? InitializeInstanceElements(_result_, _F_).
25220-
1. Return _result_.
25220+
1. Return NormalCompletion(_result_).
2522125221
1. Let _F_ be CreateBuiltinFunction(_defaultConstructor_, 0, _className_, « [[ConstructorKind]], [[SourceText]] », the current Realm Record, _constructorParent_).
2522225222
1. Else,
2522325223
1. Let _constructorInfo_ be ! DefineMethod of _constructor_ with arguments _proto_ and _constructorParent_.
@@ -27329,11 +27329,11 @@ <h1>
2732927329
1. Let _capability_ be ! NewPromiseCapability(%Promise%).
2733027330
1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and performs the following steps when called:
2733127331
1. Perform AsyncModuleExecutionFulfilled(_module_).
27332-
1. Return *undefined*.
27332+
1. Return NormalCompletion(*undefined*).
2733327333
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »).
2733427334
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_error_) that captures _module_ and performs the following steps when called:
2733527335
1. Perform AsyncModuleExecutionRejected(_module_, _error_).
27336-
1. Return *undefined*.
27336+
1. Return NormalCompletion(*undefined*).
2733727337
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 0, *""*, « »).
2733827338
1. Perform PerformPromiseThen(_capability_.[[Promise]], _onFulfilled_, _onRejected_).
2733927339
1. Perform ! <emu-meta effects="user-code">_module_.ExecuteModule</emu-meta>(_capability_).
@@ -30635,7 +30635,7 @@ <h1>Object.fromEntries ( _iterable_ )</h1>
3063530635
1. Let _closure_ be a new Abstract Closure with parameters (_key_, _value_) that captures _obj_ and performs the following steps when called:
3063630636
1. Let _propertyKey_ be ? ToPropertyKey(_key_).
3063730637
1. Perform ! CreateDataPropertyOrThrow(_obj_, _propertyKey_, _value_).
30638-
1. Return *undefined*.
30638+
1. Return NormalCompletion(*undefined*).
3063930639
1. Let _adder_ be CreateBuiltinFunction(_closure_, 2, *""*, « »).
3064030640
1. Return ? AddEntriesFromIterable(_obj_, _iterable_, _adder_).
3064130641
</emu-alg>
@@ -36315,7 +36315,7 @@ <h1>String.prototype [ %Symbol.iterator% ] ( )</h1>
3631536315
1. Let _resultString_ be the substring of _s_ from _position_ to _nextIndex_.
3631636316
1. Set _position_ to _nextIndex_.
3631736317
1. Perform ? GeneratorYield(CreateIteratorResultObject(_resultString_, *false*)).
36318-
1. Return *undefined*.
36318+
1. Return NormalCompletion(~unused~).
3631936319
1. Return CreateIteratorFromClosure(_closure_, *"%StringIteratorPrototype%"*, %StringIteratorPrototype%).
3632036320
</emu-alg>
3632136321
<p>The value of the *"name"* property of this method is *"[Symbol.iterator]"*.</p>
@@ -43262,7 +43262,7 @@ <h1>
4326243262
1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)).
4326343263
1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield.
4326443264
1. Set _numEntries_ to the number of elements in _entries_.
43265-
1. Return *undefined*.
43265+
1. Return NormalCompletion(~unused~).
4326643266
1. Return CreateIteratorFromClosure(_closure_, *"%MapIteratorPrototype%"*, %MapIteratorPrototype%).
4326743267
</emu-alg>
4326843268
</emu-clause>
@@ -43892,7 +43892,7 @@ <h1>
4389243892
1. Perform ? GeneratorYield(CreateIteratorResultObject(_e_, *false*)).
4389343893
1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield.
4389443894
1. Set _numEntries_ to the number of elements in _entries_.
43895-
1. Return *undefined*.
43895+
1. Return NormalCompletion(~unused~).
4389643896
1. Return CreateIteratorFromClosure(_closure_, *"%SetIteratorPrototype%"*, %SetIteratorPrototype%).
4389743897
</emu-alg>
4389843898
</emu-clause>
@@ -48552,7 +48552,7 @@ <h1>
4855248552
1. If _resolvingFunctions_.[[Reject]] is not *undefined*, throw a *TypeError* exception.
4855348553
1. Set _resolvingFunctions_.[[Resolve]] to _resolve_.
4855448554
1. Set _resolvingFunctions_.[[Reject]] to _reject_.
48555-
1. Return *undefined*.
48555+
1. Return NormalCompletion(*undefined*).
4855648556
1. Let _executor_ be CreateBuiltinFunction(_executorClosure_, 2, *""*, « »).
4855748557
1. Let _promise_ be ? Construct(_C_, « _executor_ »).
4855848558
1. If IsCallable(_resolvingFunctions_.[[Resolve]]) is *false*, throw a *TypeError* exception.
@@ -49259,7 +49259,7 @@ <h1>Promise.prototype.finally ( _onFinally_ )</h1>
4925949259
1. Let _result_ be ? Call(_onFinally_, *undefined*).
4926049260
1. Let _p_ be ? PromiseResolve(_C_, _result_).
4926149261
1. Let _returnValue_ be a new Abstract Closure with no parameters that captures _value_ and performs the following steps when called:
49262-
1. Return _value_.
49262+
1. Return NormalCompletion(_value_).
4926349263
1. Let _valueThunk_ be CreateBuiltinFunction(_returnValue_, 0, *""*, « »).
4926449264
1. Return ? Invoke(_p_, *"then"*, « _valueThunk_ »).
4926549265
1. Let _thenFinally_ be CreateBuiltinFunction(_thenFinallyClosure_, 1, *""*, « »).
@@ -49774,7 +49774,7 @@ <h1>
4977449774
1. Else,
4977549775
1. Assert: _result_ is a throw completion.
4977649776
1. Return ? _result_.
49777-
1. Return CreateIteratorResultObject(_resultValue_, *true*).
49777+
1. Return NormalCompletion(CreateIteratorResultObject(_resultValue_, *true*)).
4977849778
1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments.
4977949779
1. Set _generator_.[[GeneratorContext]] to _genContext_.
4978049780
1. Return ~unused~.
@@ -50134,7 +50134,7 @@ <h1>
5013450134
1. If _result_ is a return completion, set _result_ to NormalCompletion(_result_.[[Value]]).
5013550135
1. Perform AsyncGeneratorCompleteStep(_acGenerator_, _result_, *true*).
5013650136
1. Perform AsyncGeneratorDrainQueue(_acGenerator_).
50137-
1. Return *undefined*.
50137+
1. Return NormalCompletion(*undefined*).
5013850138
1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments.
5013950139
1. Set _generator_.[[AsyncGeneratorContext]] to _genContext_.
5014050140
1. Set _generator_.[[AsyncGeneratorQueue]] to a new empty List.
@@ -50311,14 +50311,14 @@ <h1>
5031150311
1. Let _result_ be NormalCompletion(_value_).
5031250312
1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*).
5031350313
1. Perform AsyncGeneratorDrainQueue(_generator_).
50314-
1. Return *undefined*.
50314+
1. Return NormalCompletion(*undefined*).
5031550315
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »).
5031650316
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _generator_ and performs the following steps when called:
5031750317
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
5031850318
1. Let _result_ be ThrowCompletion(_reason_).
5031950319
1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*).
5032050320
1. Perform AsyncGeneratorDrainQueue(_generator_).
50321-
1. Return *undefined*.
50321+
1. Return NormalCompletion(*undefined*).
5032250322
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »).
5032350323
1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_).
5032450324
1. Return ~unused~.
@@ -50527,7 +50527,7 @@ <h1>
5052750527
1. Else,
5052850528
1. Assert: _result_ is a throw completion.
5052950529
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _result_.[[Value]] »).
50530-
1. [id="step-asyncblockstart-return-undefined"] Return ~unused~.
50530+
1. [id="step-asyncblockstart-return-undefined"] Return NormalCompletion(~unused~).
5053150531
1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments.
5053250532
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
5053350533
1. <emu-meta effects="user-code">Resume the suspended evaluation of _asyncContext_</emu-meta>. Let _result_ be the value returned by the resumed computation.
@@ -50554,15 +50554,15 @@ <h1>
5055450554
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
5055550555
1. <emu-meta effects="user-code">Resume the suspended evaluation of _asyncContext_</emu-meta> using NormalCompletion(_v_) as the result of the operation that suspended it.
5055650556
1. Assert: When we reach this step, _asyncContext_ has already been removed from the execution context stack and _prevContext_ is the currently running execution context.
50557-
1. Return *undefined*.
50557+
1. Return NormalCompletion(*undefined*).
5055850558
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »).
5055950559
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _asyncContext_ and performs the following steps when called:
5056050560
1. Let _prevContext_ be the running execution context.
5056150561
1. Suspend _prevContext_.
5056250562
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
5056350563
1. <emu-meta effects="user-code">Resume the suspended evaluation of _asyncContext_</emu-meta> using ThrowCompletion(_reason_) as the result of the operation that suspended it.
5056450564
1. Assert: When we reach this step, _asyncContext_ has already been removed from the execution context stack and _prevContext_ is the currently running execution context.
50565-
1. Return *undefined*.
50565+
1. Return NormalCompletion(*undefined*).
5056650566
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »).
5056750567
1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_).
5056850568
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.
@@ -50776,12 +50776,12 @@ <h1>Proxy.revocable ( _target_, _handler_ )</h1>
5077650776
1. Let _revokerClosure_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called:
5077750777
1. Let _F_ be the active function object.
5077850778
1. Let _p_ be _F_.[[RevocableProxy]].
50779-
1. If _p_ is *null*, return *undefined*.
50779+
1. If _p_ is *null*, return NormalCompletion(*undefined*).
5078050780
1. Set _F_.[[RevocableProxy]] to *null*.
5078150781
1. Assert: _p_ is a Proxy exotic object.
5078250782
1. Set _p_.[[ProxyTarget]] to *null*.
5078350783
1. Set _p_.[[ProxyHandler]] to *null*.
50784-
1. Return *undefined*.
50784+
1. Return NormalCompletion(*undefined*).
5078550785
1. Let _revoker_ be CreateBuiltinFunction(_revokerClosure_, 0, *""*, « [[RevocableProxy]] »).
5078650786
1. Set _revoker_.[[RevocableProxy]] to _proxy_.
5078750787
1. Let _result_ be OrdinaryObjectCreate(%Object.prototype%).

0 commit comments

Comments
 (0)