Skip to content

Commit ac44bdf

Browse files
michaelficarraljharb
authored andcommitted
Editorial: wrap AC return values in completion records where needed (#3601)
1 parent 9b6a4a4 commit ac44bdf

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
@@ -14731,7 +14731,7 @@ <h1>
1473114731
</dl>
1473214732
<emu-alg>
1473314733
1. Let _getterClosure_ be a new Abstract Closure with no parameters that captures _name_ and _env_ and performs the following steps when called:
14734-
1. Return ! _env_.GetBindingValue(_name_, *false*).
14734+
1. Return NormalCompletion(! _env_.GetBindingValue(_name_, *false*)).
1473514735
1. Let _getter_ be CreateBuiltinFunction(_getterClosure_, 0, *""*, « »).
1473614736
1. NOTE: _getter_ is never directly accessible to ECMAScript code.
1473714737
1. Return _getter_.
@@ -14751,7 +14751,7 @@ <h1>
1475114751
</dl>
1475214752
<emu-alg>
1475314753
1. Let _setterClosure_ be a new Abstract Closure with parameters (_value_) that captures _name_ and _env_ and performs the following steps when called:
14754-
1. Return ! _env_.SetMutableBinding(_name_, _value_, *false*).
14754+
1. Return NormalCompletion(! _env_.SetMutableBinding(_name_, _value_, *false*)).
1475514755
1. Let _setter_ be CreateBuiltinFunction(_setterClosure_, 1, *""*, « »).
1475614756
1. NOTE: _setter_ is never directly accessible to ECMAScript code.
1475714757
1. Return _setter_.
@@ -19871,18 +19871,18 @@ <h1>
1987119871
1. Let _loadPromise_ be _module_.LoadRequestedModules().
1987219872
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called:
1987319873
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »).
19874-
1. Return ~unused~.
19874+
1. Return NormalCompletion(*undefined*).
1987519875
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »).
1987619876
1. Let _linkAndEvaluateClosure_ be a new Abstract Closure with no parameters that captures _module_, _promiseCapability_, and _onRejected_ and performs the following steps when called:
1987719877
1. Let _link_ be Completion(_module_.Link()).
1987819878
1. If _link_ is an abrupt completion, then
1987919879
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _link_.[[Value]] »).
19880-
1. Return ~unused~.
19880+
1. Return NormalCompletion(*undefined*).
1988119881
1. Let _evaluatePromise_ be _module_.Evaluate().
1988219882
1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and _promiseCapability_ and performs the following steps when called:
1988319883
1. Let _namespace_ be GetModuleNamespace(_module_).
1988419884
1. Perform ! <emu-meta effects="user-code">Call</emu-meta>(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_ »).
19885-
1. Return ~unused~.
19885+
1. Return NormalCompletion(*undefined*).
1988619886
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »).
1988719887
1. Perform PerformPromiseThen(_evaluatePromise_, _onFulfilled_, _onRejected_).
1988819888
1. Return ~unused~.
@@ -25240,7 +25240,7 @@ <h1>
2524025240
1. NOTE: This branch behaves similarly to `constructor() {}`.
2524125241
1. Let _result_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Object.prototype%"*).
2524225242
1. Perform ? InitializeInstanceElements(_result_, _F_).
25243-
1. Return _result_.
25243+
1. Return NormalCompletion(_result_).
2524425244
1. Let _F_ be CreateBuiltinFunction(_defaultConstructor_, 0, _className_, « [[ConstructorKind]], [[SourceText]] », the current Realm Record, _constructorParent_).
2524525245
1. Else,
2524625246
1. Let _constructorInfo_ be ! DefineMethod of _constructor_ with arguments _proto_ and _constructorParent_.
@@ -27352,11 +27352,11 @@ <h1>
2735227352
1. Let _capability_ be ! NewPromiseCapability(%Promise%).
2735327353
1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and performs the following steps when called:
2735427354
1. Perform AsyncModuleExecutionFulfilled(_module_).
27355-
1. Return *undefined*.
27355+
1. Return NormalCompletion(*undefined*).
2735627356
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »).
2735727357
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_error_) that captures _module_ and performs the following steps when called:
2735827358
1. Perform AsyncModuleExecutionRejected(_module_, _error_).
27359-
1. Return *undefined*.
27359+
1. Return NormalCompletion(*undefined*).
2736027360
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 0, *""*, « »).
2736127361
1. Perform PerformPromiseThen(_capability_.[[Promise]], _onFulfilled_, _onRejected_).
2736227362
1. Perform ! <emu-meta effects="user-code">_module_.ExecuteModule</emu-meta>(_capability_).
@@ -30658,7 +30658,7 @@ <h1>Object.fromEntries ( _iterable_ )</h1>
3065830658
1. Let _closure_ be a new Abstract Closure with parameters (_key_, _value_) that captures _obj_ and performs the following steps when called:
3065930659
1. Let _propertyKey_ be ? ToPropertyKey(_key_).
3066030660
1. Perform ! CreateDataPropertyOrThrow(_obj_, _propertyKey_, _value_).
30661-
1. Return *undefined*.
30661+
1. Return NormalCompletion(*undefined*).
3066230662
1. Let _adder_ be CreateBuiltinFunction(_closure_, 2, *""*, « »).
3066330663
1. Return ? AddEntriesFromIterable(_obj_, _iterable_, _adder_).
3066430664
</emu-alg>
@@ -36338,7 +36338,7 @@ <h1>String.prototype [ %Symbol.iterator% ] ( )</h1>
3633836338
1. Let _resultString_ be the substring of _s_ from _position_ to _nextIndex_.
3633936339
1. Set _position_ to _nextIndex_.
3634036340
1. Perform ? GeneratorYield(CreateIteratorResultObject(_resultString_, *false*)).
36341-
1. Return *undefined*.
36341+
1. Return NormalCompletion(~unused~).
3634236342
1. Return CreateIteratorFromClosure(_closure_, *"%StringIteratorPrototype%"*, %StringIteratorPrototype%).
3634336343
</emu-alg>
3634436344
<p>The value of the *"name"* property of this method is *"[Symbol.iterator]"*.</p>
@@ -43284,7 +43284,7 @@ <h1>
4328443284
1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)).
4328543285
1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield.
4328643286
1. Set _numEntries_ to the number of elements in _entries_.
43287-
1. Return *undefined*.
43287+
1. Return NormalCompletion(~unused~).
4328843288
1. Return CreateIteratorFromClosure(_closure_, *"%MapIteratorPrototype%"*, %MapIteratorPrototype%).
4328943289
</emu-alg>
4329043290
</emu-clause>
@@ -43914,7 +43914,7 @@ <h1>
4391443914
1. Perform ? GeneratorYield(CreateIteratorResultObject(_e_, *false*)).
4391543915
1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield.
4391643916
1. Set _numEntries_ to the number of elements in _entries_.
43917-
1. Return *undefined*.
43917+
1. Return NormalCompletion(~unused~).
4391843918
1. Return CreateIteratorFromClosure(_closure_, *"%SetIteratorPrototype%"*, %SetIteratorPrototype%).
4391943919
</emu-alg>
4392043920
</emu-clause>
@@ -48574,7 +48574,7 @@ <h1>
4857448574
1. If _resolvingFunctions_.[[Reject]] is not *undefined*, throw a *TypeError* exception.
4857548575
1. Set _resolvingFunctions_.[[Resolve]] to _resolve_.
4857648576
1. Set _resolvingFunctions_.[[Reject]] to _reject_.
48577-
1. Return *undefined*.
48577+
1. Return NormalCompletion(*undefined*).
4857848578
1. Let _executor_ be CreateBuiltinFunction(_executorClosure_, 2, *""*, « »).
4857948579
1. Let _promise_ be ? Construct(_C_, « _executor_ »).
4858048580
1. If IsCallable(_resolvingFunctions_.[[Resolve]]) is *false*, throw a *TypeError* exception.
@@ -49281,7 +49281,7 @@ <h1>Promise.prototype.finally ( _onFinally_ )</h1>
4928149281
1. Let _result_ be ? Call(_onFinally_, *undefined*).
4928249282
1. Let _p_ be ? PromiseResolve(_C_, _result_).
4928349283
1. Let _returnValue_ be a new Abstract Closure with no parameters that captures _value_ and performs the following steps when called:
49284-
1. Return _value_.
49284+
1. Return NormalCompletion(_value_).
4928549285
1. Let _valueThunk_ be CreateBuiltinFunction(_returnValue_, 0, *""*, « »).
4928649286
1. Return ? Invoke(_p_, *"then"*, « _valueThunk_ »).
4928749287
1. Let _thenFinally_ be CreateBuiltinFunction(_thenFinallyClosure_, 1, *""*, « »).
@@ -49796,7 +49796,7 @@ <h1>
4979649796
1. Else,
4979749797
1. Assert: _result_ is a throw completion.
4979849798
1. Return ? _result_.
49799-
1. Return CreateIteratorResultObject(_resultValue_, *true*).
49799+
1. Return NormalCompletion(CreateIteratorResultObject(_resultValue_, *true*)).
4980049800
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.
4980149801
1. Set _generator_.[[GeneratorContext]] to _genContext_.
4980249802
1. Return ~unused~.
@@ -50156,7 +50156,7 @@ <h1>
5015650156
1. If _result_ is a return completion, set _result_ to NormalCompletion(_result_.[[Value]]).
5015750157
1. Perform AsyncGeneratorCompleteStep(_acGenerator_, _result_, *true*).
5015850158
1. Perform AsyncGeneratorDrainQueue(_acGenerator_).
50159-
1. Return *undefined*.
50159+
1. Return NormalCompletion(*undefined*).
5016050160
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.
5016150161
1. Set _generator_.[[AsyncGeneratorContext]] to _genContext_.
5016250162
1. Set _generator_.[[AsyncGeneratorQueue]] to a new empty List.
@@ -50333,14 +50333,14 @@ <h1>
5033350333
1. Let _result_ be NormalCompletion(_value_).
5033450334
1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*).
5033550335
1. Perform AsyncGeneratorDrainQueue(_generator_).
50336-
1. Return *undefined*.
50336+
1. Return NormalCompletion(*undefined*).
5033750337
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »).
5033850338
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _generator_ and performs the following steps when called:
5033950339
1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~.
5034050340
1. Let _result_ be ThrowCompletion(_reason_).
5034150341
1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*).
5034250342
1. Perform AsyncGeneratorDrainQueue(_generator_).
50343-
1. Return *undefined*.
50343+
1. Return NormalCompletion(*undefined*).
5034450344
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »).
5034550345
1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_).
5034650346
1. Return ~unused~.
@@ -50549,7 +50549,7 @@ <h1>
5054950549
1. Else,
5055050550
1. Assert: _result_ is a throw completion.
5055150551
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _result_.[[Value]] »).
50552-
1. [id="step-asyncblockstart-return-undefined"] Return ~unused~.
50552+
1. [id="step-asyncblockstart-return-undefined"] Return NormalCompletion(~unused~).
5055350553
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.
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>. Let _result_ be the value returned by the resumed computation.
@@ -50576,15 +50576,15 @@ <h1>
5057650576
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
5057750577
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.
5057850578
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.
50579-
1. Return *undefined*.
50579+
1. Return NormalCompletion(*undefined*).
5058050580
1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »).
5058150581
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _asyncContext_ and performs the following steps when called:
5058250582
1. Let _prevContext_ be the running execution context.
5058350583
1. Suspend _prevContext_.
5058450584
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
5058550585
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.
5058650586
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.
50587-
1. Return *undefined*.
50587+
1. Return NormalCompletion(*undefined*).
5058850588
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »).
5058950589
1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_).
5059050590
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.
@@ -50798,12 +50798,12 @@ <h1>Proxy.revocable ( _target_, _handler_ )</h1>
5079850798
1. Let _revokerClosure_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called:
5079950799
1. Let _F_ be the active function object.
5080050800
1. Let _p_ be _F_.[[RevocableProxy]].
50801-
1. If _p_ is *null*, return *undefined*.
50801+
1. If _p_ is *null*, return NormalCompletion(*undefined*).
5080250802
1. Set _F_.[[RevocableProxy]] to *null*.
5080350803
1. Assert: _p_ is a Proxy exotic object.
5080450804
1. Set _p_.[[ProxyTarget]] to *null*.
5080550805
1. Set _p_.[[ProxyHandler]] to *null*.
50806-
1. Return *undefined*.
50806+
1. Return NormalCompletion(*undefined*).
5080750807
1. Let _revoker_ be CreateBuiltinFunction(_revokerClosure_, 0, *""*, « [[RevocableProxy]] »).
5080850808
1. Set _revoker_.[[RevocableProxy]] to _proxy_.
5080950809
1. Let _result_ be OrdinaryObjectCreate(%Object.prototype%).

0 commit comments

Comments
 (0)