@@ -3210,7 +3210,8 @@ <h1>GetValue ( _V_ )</h1>
3210
3210
1. Assert: In this case, _base_ will never be *undefined* or *null*.
3211
3211
1. Set _base_ to ! ToObject(_base_).
3212
3212
1. Return ? _base_.[[Get]](GetReferencedName(_V_), GetThisValue(_V_)).
3213
- 1. Else _base_ must be an Environment Record,
3213
+ 1. Else,
3214
+ 1. Assert: _base_ is an Environment Record.
3214
3215
1. Return ? _base_.GetBindingValue(GetReferencedName(_V_), IsStrictReference(_V_)) (see <emu-xref href="#sec-environment-records"></emu-xref>).
3215
3216
</emu-alg>
3216
3217
<emu-note>
@@ -3237,7 +3238,8 @@ <h1>PutValue ( _V_, _W_ )</h1>
3237
3238
1. Let _succeeded_ be ? _base_.[[Set]](GetReferencedName(_V_), _W_, GetThisValue(_V_)).
3238
3239
1. If _succeeded_ is *false* and IsStrictReference(_V_) is *true*, throw a *TypeError* exception.
3239
3240
1. Return.
3240
- 1. Else _base_ must be an Environment Record,
3241
+ 1. Else,
3242
+ 1. Assert: _base_ is an Environment Record.
3241
3243
1. Return ? _base_.SetMutableBinding(GetReferencedName(_V_), _W_, IsStrictReference(_V_)) (see <emu-xref href="#sec-environment-records"></emu-xref>).
3242
3244
</emu-alg>
3243
3245
<emu-note>
@@ -3478,7 +3480,9 @@ <h1>ToPrimitive ( _input_ [ , _PreferredType_ ] )</h1>
3478
3480
1. If Type(_input_) is Object, then
3479
3481
1. If _PreferredType_ is not present, let _hint_ be `"default"`.
3480
3482
1. Else if _PreferredType_ is hint String, let _hint_ be `"string"`.
3481
- 1. Else _PreferredType_ is hint Number, let _hint_ be `"number"`.
3483
+ 1. Else,
3484
+ 1. Assert: _PreferredType_ is hint Number.
3485
+ 1. Let _hint_ be `"number"`.
3482
3486
1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive).
3483
3487
1. If _exoticToPrim_ is not *undefined*, then
3484
3488
1. Let _result_ be ? Call(_exoticToPrim_, _input_, « _hint_ »).
@@ -4436,7 +4440,8 @@ <h1>Abstract Relational Comparison</h1>
4436
4440
1. If the _LeftFirst_ flag is *true*, then
4437
4441
1. Let _px_ be ? ToPrimitive(_x_, hint Number).
4438
4442
1. Let _py_ be ? ToPrimitive(_y_, hint Number).
4439
- 1. Else the order of evaluation needs to be reversed to preserve left to right evaluation,
4443
+ 1. Else,
4444
+ 1. NOTE: The order of evaluation needs to be reversed to preserve left to right evaluation.
4440
4445
1. Let _py_ be ? ToPrimitive(_y_, hint Number).
4441
4446
1. Let _px_ be ? ToPrimitive(_x_, hint Number).
4442
4447
1. If Type(_px_) is String and Type(_py_) is String, then
@@ -4681,7 +4686,8 @@ <h1>SetIntegrityLevel ( _O_, _level_ )</h1>
4681
4686
1. If _level_ is `"sealed"`, then
4682
4687
1. For each element _k_ of _keys_, do
4683
4688
1. Perform ? DefinePropertyOrThrow(_O_, _k_, PropertyDescriptor { [[Configurable]]: *false* }).
4684
- 1. Else _level_ is `"frozen"`,
4689
+ 1. Else,
4690
+ 1. Assert: _level_ is `"frozen"`.
4685
4691
1. For each element _k_ of _keys_, do
4686
4692
1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_).
4687
4693
1. If _currentDesc_ is not *undefined*, then
@@ -6597,7 +6603,8 @@ <h1>RunJobs ( )</h1>
6597
6603
1. In an implementation-dependent manner, obtain the ECMAScript source texts (see clause <emu-xref href="#sec-ecmascript-language-source-code"></emu-xref>) and any associated host-defined values for zero or more ECMAScript scripts and/or ECMAScript modules. For each such _sourceText_ and _hostDefined_, do
6598
6604
1. If _sourceText_ is the source code of a script, then
6599
6605
1. Perform EnqueueJob(`"ScriptJobs"`, ScriptEvaluationJob, « _sourceText_, _hostDefined_ »).
6600
- 1. Else _sourceText_ is the source code of a module,
6606
+ 1. Else,
6607
+ 1. Assert: _sourceText_ is the source code of a module.
6601
6608
1. Perform EnqueueJob(`"ScriptJobs"`, TopLevelModuleEvaluationJob, « _sourceText_, _hostDefined_ »).
6602
6609
1. Repeat,
6603
6610
1. Suspend the running execution context and remove it from the execution context stack.
@@ -6885,7 +6892,8 @@ <h1>OrdinaryGetOwnProperty ( _O_, _P_ )</h1>
6885
6892
1. If _X_ is a data property, then
6886
6893
1. Set _D_.[[Value]] to the value of _X_'s [[Value]] attribute.
6887
6894
1. Set _D_.[[Writable]] to the value of _X_'s [[Writable]] attribute.
6888
- 1. Else _X_ is an accessor property,
6895
+ 1. Else,
6896
+ 1. Assert: _X_ is an accessor property.
6889
6897
1. Set _D_.[[Get]] to the value of _X_'s [[Get]] attribute.
6890
6898
1. Set _D_.[[Set]] to the value of _X_'s [[Set]] attribute.
6891
6899
1. Set _D_.[[Enumerable]] to the value of _X_'s [[Enumerable]] attribute.
@@ -6933,7 +6941,8 @@ <h1>ValidateAndApplyPropertyDescriptor ( _O_, _P_, _extensible_, _Desc_, _curren
6933
6941
1. Assert: _extensible_ is *true*.
6934
6942
1. If IsGenericDescriptor(_Desc_) is *true* or IsDataDescriptor(_Desc_) is *true*, then
6935
6943
1. If _O_ is not *undefined*, create an own data property named _P_ of object _O_ whose [[Value]], [[Writable]], [[Enumerable]] and [[Configurable]] attribute values are described by _Desc_. If the value of an attribute field of _Desc_ is absent, the attribute of the newly created property is set to its default value.
6936
- 1. Else _Desc_ must be an accessor Property Descriptor,
6944
+ 1. Else,
6945
+ 1. Assert: ! IsAccessorDescriptor(_Desc_) is *true*.
6937
6946
1. If _O_ is not *undefined*, create an own accessor property named _P_ of object _O_ whose [[Get]], [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by _Desc_. If the value of an attribute field of _Desc_ is absent, the attribute of the newly created property is set to its default value.
6938
6947
1. Return *true*.
6939
6948
1. If every field in _Desc_ is absent, return *true*.
@@ -6952,7 +6961,8 @@ <h1>ValidateAndApplyPropertyDescriptor ( _O_, _P_, _extensible_, _Desc_, _curren
6952
6961
1. If _Desc_.[[Writable]] is present and _Desc_.[[Writable]] is *true*, return *false*.
6953
6962
1. If _Desc_.[[Value]] is present and SameValue(_Desc_.[[Value]], _current_.[[Value]]) is *false*, return *false*.
6954
6963
1. Return *true*.
6955
- 1. Else IsAccessorDescriptor(_current_) and IsAccessorDescriptor(_Desc_) are both *true*,
6964
+ 1. Else,
6965
+ 1. Assert: ! IsAccessorDescriptor(_current_) and ! IsAccessorDescriptor(_Desc_) are both *true*.
6956
6966
1. If _current_.[[Configurable]] is *false*, then
6957
6967
1. If _Desc_.[[Set]] is present and SameValue(_Desc_.[[Set]], _current_.[[Set]]) is *false*, return *false*.
6958
6968
1. If _Desc_.[[Get]] is present and SameValue(_Desc_.[[Get]], _current_.[[Get]]) is *false*, return *false*.
@@ -7053,7 +7063,8 @@ <h1>OrdinarySetWithOwnDescriptor ( _O_, _P_, _V_, _Receiver_, _ownDesc_ )</h1>
7053
7063
1. If _existingDescriptor_.[[Writable]] is *false*, return *false*.
7054
7064
1. Let _valueDesc_ be the PropertyDescriptor { [[Value]]: _V_ }.
7055
7065
1. Return ? _Receiver_.[[DefineOwnProperty]](_P_, _valueDesc_).
7056
- 1. Else _Receiver_ does not currently have a property _P_,
7066
+ 1. Else,
7067
+ 1. Assert: _Receiver_ does not currently have a property _P_.
7057
7068
1. Return ? CreateDataProperty(_Receiver_, _P_, _V_).
7058
7069
1. Assert: IsAccessorDescriptor(_ownDesc_) is *true*.
7059
7070
1. Let _setter_ be _ownDesc_.[[Set]].
@@ -8144,7 +8155,8 @@ <h1>[[Get]] ( _P_, _Receiver_ )</h1>
8144
8155
1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_).
8145
8156
1. If _isMapped_ is *false*, then
8146
8157
1. Return ? OrdinaryGet(_args_, _P_, _Receiver_).
8147
- 1. Else _map_ contains a formal parameter mapping for _P_,
8158
+ 1. Else,
8159
+ 1. Assert: _map_ contains a formal parameter mapping for _P_.
8148
8160
1. Return Get(_map_, _P_).
8149
8161
</emu-alg>
8150
8162
</emu-clause>
@@ -12581,10 +12593,11 @@ <h1>Runtime Semantics: EvaluateCall ( _func_, _ref_, _arguments_, _tailPosition_
12581
12593
1. If Type(_ref_) is Reference, then
12582
12594
1. If IsPropertyReference(_ref_) is *true*, then
12583
12595
1. Let _thisValue_ be GetThisValue(_ref_).
12584
- 1. Else the base of _ref_ is an Environment Record,
12596
+ 1. Else,
12597
+ 1. Assert: the base of _ref_ is an Environment Record.
12585
12598
1. Let _refEnv_ be GetBase(_ref_).
12586
12599
1. Let _thisValue_ be _refEnv_.WithBaseObject().
12587
- 1. Else Type(_ref_) is not Reference ,
12600
+ 1. Else,
12588
12601
1. Let _thisValue_ be *undefined*.
12589
12602
1. Let _argList_ be ArgumentListEvaluation of _arguments_.
12590
12603
1. ReturnIfAbrupt(_argList_).
@@ -12988,7 +13001,8 @@ <h1>Runtime Semantics: Evaluation</h1>
12988
13001
1. Let _deleteStatus_ be ? _baseObj_.[[Delete]](GetReferencedName(_ref_)).
12989
13002
1. If _deleteStatus_ is *false* and IsStrictReference(_ref_) is *true*, throw a *TypeError* exception.
12990
13003
1. Return _deleteStatus_.
12991
- 1. Else _ref_ is a Reference to an Environment Record binding,
13004
+ 1. Else,
13005
+ 1. Assert: _ref_ is a Reference to an Environment Record binding.
12992
13006
1. Let _bindings_ be GetBase(_ref_).
12993
13007
1. Return ? _bindings_.DeleteBinding(GetReferencedName(_ref_)).
12994
13008
</emu-alg>
@@ -22408,9 +22422,10 @@ <h1>ParseModule ( _sourceText_, _realm_, _hostDefined_ )</h1>
22408
22422
1. Else,
22409
22423
1. Let _ie_ be the element of _importEntries_ whose [[LocalName]] is the same as _ee_.[[LocalName]].
22410
22424
1. If _ie_.[[ImportName]] is `"*"`, then
22411
- 1. Assert : This is a re-export of an imported module namespace object.
22425
+ 1. NOTE : This is a re-export of an imported module namespace object.
22412
22426
1. Append _ee_ to _localExportEntries_.
22413
- 1. Else this is a re-export of a single name,
22427
+ 1. Else,
22428
+ 1. NOTE: This is a re-export of a single name.
22414
22429
1. Append the ExportEntry Record { [[ModuleRequest]]: _ie_.[[ModuleRequest]], [[ImportName]]: _ie_.[[ImportName]], [[LocalName]]: *null*, [[ExportName]]: _ee_.[[ExportName]] } to _indirectExportEntries_.
22415
22430
1. Else if _ee_.[[ImportName]] is `"*"`, then
22416
22431
1. Append _ee_ to _starExportEntries_.
@@ -23768,7 +23783,8 @@ <h1>Runtime Semantics: Decode ( _string_, _reservedSet_ )</h1>
23768
23783
1. Let _S_ be the String value containing only the code unit _C_.
23769
23784
1. Else,
23770
23785
1. Let _S_ be the substring of _string_ from index _start_ to index _k_ inclusive.
23771
- 1. Else the most significant bit in _B_ is 1,
23786
+ 1. Else,
23787
+ 1. Assert: the most significant bit in _B_ is 1.
23772
23788
1. Let _n_ be the smallest nonnegative integer such that (_B_ << _n_) & 0x80 is equal to 0.
23773
23789
1. If _n_ equals 1 or _n_ is greater than 4, throw a *URIError* exception.
23774
23790
1. Let _Octets_ be a List of 8-bit integers of size _n_.
@@ -24727,7 +24743,8 @@ <h1>Runtime Semantics: CreateDynamicFunction ( _constructor_, _newTarget_, _kind
24727
24743
1. Let _P_ be the empty String.
24728
24744
1. If _argCount_ = 0, let _bodyText_ be the empty String.
24729
24745
1. Else if _argCount_ = 1, let _bodyText_ be _args_[0].
24730
- 1. Else _argCount_ > 1,
24746
+ 1. Else,
24747
+ 1. Assert: _argCount_ > 1.
24731
24748
1. Let _firstArg_ be _args_[0].
24732
24749
1. Set _P_ to ? ToString(_firstArg_).
24733
24750
1. Let _k_ be 1.
@@ -25848,7 +25865,8 @@ <h1>Number.prototype.toPrecision ( _precision_ )</h1>
25848
25865
1. Set _m_ to the string-concatenation of _a_, `"."`, and _b_.
25849
25866
1. If _e_ > 0, then
25850
25867
1. Let _c_ be the code unit 0x002B (PLUS SIGN).
25851
- 1. Else _e_ < 0,
25868
+ 1. Else,
25869
+ 1. Assert: _e_ < 0.
25852
25870
1. Let _c_ be the code unit 0x002D (HYPHEN-MINUS).
25853
25871
1. Set _e_ to -_e_.
25854
25872
1. Let _d_ be the String value consisting of the digits of the decimal representation of _e_ (in order, with no leading zeroes).
@@ -28842,7 +28860,8 @@ <h1>String.prototype.split ( _separator_, _limit_ )</h1>
28842
28860
1. Repeat, while _q_ ≠ _s_
28843
28861
1. Let _e_ be SplitMatch(_S_, _q_, _R_).
28844
28862
1. If _e_ is *false*, set _q_ to _q_ + 1.
28845
- 1. Else _e_ is an integer index ≤ _s_,
28863
+ 1. Else,
28864
+ 1. Assert: _e_ is an integer index ≤ _s_.
28846
28865
1. If _e_ = _p_, set _q_ to _q_ + 1.
28847
28866
1. Else,
28848
28867
1. Let _T_ be the String value equal to the substring of _S_ consisting of the code units at indices _p_ (inclusive) through _q_ (exclusive).
@@ -30995,7 +31014,8 @@ <h1>Runtime Semantics: RegExpBuiltinExec ( _R_, _S_ )</h1>
30995
31014
1. Else if _fullUnicode_ is *true*, then
30996
31015
1. Assert: _captureI_ is a List of code points.
30997
31016
1. Let _capturedValue_ be the String value whose code units are the UTF16Encoding of the code points of _captureI_.
30998
- 1. Else _fullUnicode_ is *false*,
31017
+ 1. Else,
31018
+ 1. Assert: _fullUnicode_ is *false*.
30999
31019
1. Assert: _captureI_ is a List of code units.
31000
31020
1. Let _capturedValue_ be the String value consisting of the code units of _captureI_.
31001
31021
1. Perform ! CreateDataProperty(_A_, ! ToString(_i_), _capturedValue_).
@@ -31100,7 +31120,8 @@ <h1>RegExp.prototype [ @@match ] ( _string_ )</h1>
31100
31120
1. Let _global_ be ToBoolean(? Get(_rx_, `"global"`)).
31101
31121
1. If _global_ is *false*, then
31102
31122
1. Return ? RegExpExec(_rx_, _S_).
31103
- 1. Else _global_ is *true*,
31123
+ 1. Else,
31124
+ 1. Assert: _global_ is *true*.
31104
31125
1. Let _fullUnicode_ be ToBoolean(? Get(_rx_, `"unicode"`)).
31105
31126
1. Perform ? Set(_rx_, `"lastIndex"`, 0, *true*).
31106
31127
1. Let _A_ be ! ArrayCreate(0).
@@ -31755,7 +31776,8 @@ <h1>Array.prototype.concat ( ..._arguments_ )</h1>
31755
31776
1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(_n_), _subElement_).
31756
31777
1. Set _n_ to _n_ + 1.
31757
31778
1. Set _k_ to _k_ + 1.
31758
- 1. Else _E_ is added as a single item rather than spread,
31779
+ 1. Else,
31780
+ 1. NOTE: _E_ is added as a single item rather than spread.
31759
31781
1. If _n_ ≥ 2<sup>53</sup> - 1, throw a *TypeError* exception.
31760
31782
1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(_n_), _E_).
31761
31783
1. Set _n_ to _n_ + 1.
@@ -31817,7 +31839,8 @@ <h1>Array.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )</h1>
31817
31839
1. If _fromPresent_ is *true*, then
31818
31840
1. Let _fromVal_ be ? Get(_O_, _fromKey_).
31819
31841
1. Perform ? Set(_O_, _toKey_, _fromVal_, *true*).
31820
- 1. Else _fromPresent_ is *false*,
31842
+ 1. Else,
31843
+ 1. Assert: _fromPresent_ is *false*.
31821
31844
1. Perform ? DeletePropertyOrThrow(_O_, _toKey_).
31822
31845
1. Set _from_ to _from_ + _direction_.
31823
31846
1. Set _to_ to _to_ + _direction_.
@@ -32257,7 +32280,8 @@ <h1>Array.prototype.pop ( )</h1>
32257
32280
1. If _len_ is zero, then
32258
32281
1. Perform ? Set(_O_, `"length"`, 0, *true*).
32259
32282
1. Return *undefined*.
32260
- 1. Else _len_ > 0,
32283
+ 1. Else,
32284
+ 1. Assert: _len_ > 0.
32261
32285
1. Let _newLen_ be _len_ - 1.
32262
32286
1. Let _index_ be ! ToString(_newLen_).
32263
32287
1. Let _element_ be ? Get(_O_, _index_).
@@ -32407,7 +32431,8 @@ <h1>Array.prototype.reverse ( )</h1>
32407
32431
1. Else if _lowerExists_ is *true* and _upperExists_ is *false*, then
32408
32432
1. Perform ? DeletePropertyOrThrow(_O_, _lowerP_).
32409
32433
1. Perform ? Set(_O_, _upperP_, _lowerValue_, *true*).
32410
- 1. Else both _lowerExists_ and _upperExists_ are *false*,
32434
+ 1. Else,
32435
+ 1. Assert: _lowerExists_ and _upperExists_ are both *false*.
32411
32436
1. No action is required.
32412
32437
1. Set _lower_ to _lower_ + 1.
32413
32438
1. Return _O_.
@@ -32438,7 +32463,8 @@ <h1>Array.prototype.shift ( )</h1>
32438
32463
1. If _fromPresent_ is *true*, then
32439
32464
1. Let _fromVal_ be ? Get(_O_, _from_).
32440
32465
1. Perform ? Set(_O_, _to_, _fromVal_, *true*).
32441
- 1. Else _fromPresent_ is *false*,
32466
+ 1. Else,
32467
+ 1. Assert: _fromPresent_ is *false*.
32442
32468
1. Perform ? DeletePropertyOrThrow(_O_, _to_).
32443
32469
1. Set _k_ to _k_ + 1.
32444
32470
1. Perform ? DeletePropertyOrThrow(_O_, ! ToString(_len_ - 1)).
@@ -32692,7 +32718,8 @@ <h1>Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )</h1>
32692
32718
1. If _fromPresent_ is *true*, then
32693
32719
1. Let _fromValue_ be ? Get(_O_, _from_).
32694
32720
1. Perform ? Set(_O_, _to_, _fromValue_, *true*).
32695
- 1. Else _fromPresent_ is *false*,
32721
+ 1. Else,
32722
+ 1. Assert: _fromPresent_ is *false*.
32696
32723
1. Perform ? DeletePropertyOrThrow(_O_, _to_).
32697
32724
1. Set _k_ to _k_ + 1.
32698
32725
1. Set _k_ to _len_.
@@ -32708,7 +32735,8 @@ <h1>Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )</h1>
32708
32735
1. If _fromPresent_ is *true*, then
32709
32736
1. Let _fromValue_ be ? Get(_O_, _from_).
32710
32737
1. Perform ? Set(_O_, _to_, _fromValue_, *true*).
32711
- 1. Else _fromPresent_ is *false*,
32738
+ 1. Else,
32739
+ 1. Assert: _fromPresent_ is *false*.
32712
32740
1. Perform ? DeletePropertyOrThrow(_O_, _to_).
32713
32741
1. Set _k_ to _k_ - 1.
32714
32742
1. Set _k_ to _actualStart_.
@@ -32793,7 +32821,8 @@ <h1>Array.prototype.unshift ( ..._items_ )</h1>
32793
32821
1. If _fromPresent_ is *true*, then
32794
32822
1. Let _fromValue_ be ? Get(_O_, _from_).
32795
32823
1. Perform ? Set(_O_, _to_, _fromValue_, *true*).
32796
- 1. Else _fromPresent_ is *false*,
32824
+ 1. Else,
32825
+ 1. Assert: _fromPresent_ is *false*.
32797
32826
1. Perform ? DeletePropertyOrThrow(_O_, _to_).
32798
32827
1. Set _k_ to _k_ - 1.
32799
32828
1. Let _j_ be 0.
@@ -40505,7 +40534,8 @@ <h1>escape ( _string_ )</h1>
40505
40534
1. Let _S_ be the string-concatenation of:
40506
40535
* `"%u"`
40507
40536
* the String representation of _n_, formatted as a four-digit uppercase hexadecimal number, padded to the left with zeroes if necessary
40508
- 1. Else _char_ < 256,
40537
+ 1. Else,
40538
+ 1. Assert: _char_ < 256.
40509
40539
1. Let _n_ be the numeric value of _char_.
40510
40540
1. Let _S_ be the string-concatenation of:
40511
40541
* `"%"`
0 commit comments