From 4fde51429522cfd3feb09f2a023af30ff1f5a27d Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 25 Aug 2021 14:35:22 -0700 Subject: [PATCH] Editorial: move assertions about AO parameter types into AO header metadata (#2483) --- spec.html | 535 +++++++++++++++++------------------------------------- 1 file changed, 168 insertions(+), 367 deletions(-) diff --git a/spec.html b/spec.html index a6ba8c1da0..19b2508938 100644 --- a/spec.html +++ b/spec.html @@ -544,7 +544,7 @@

The Syntactic Grammar

eval(str); eval(str); -

Each call to `eval` converts the value of `str` into an ECMAScript source text and performs an independent parse that creates its own separate tree of Parse Nodes. The trees are distinct even though each parse operates upon a source text that was derived from the same String value.

+

Each call to `eval` converts the value of `str` into ECMAScript source text and performs an independent parse that creates its own separate tree of Parse Nodes. The trees are distinct even though each parse operates upon a source text that was derived from the same String value.

Parse Nodes are specification artefacts, and implementations are not required to use an analogous data structure.

Productions of the syntactic grammar are distinguished by having just one colon “:” as punctuation.

@@ -1029,9 +1029,6 @@

- 1. Assert: Type(_string_) is String. - 1. Assert: Type(_searchValue_) is String. - 1. Assert: _fromIndex_ is a non-negative integer. 1. Let _len_ be the length of _string_. 1. If _searchValue_ is the empty String and _fromIndex_ ≤ _len_, return _fromIndex_. 1. Let _searchLen_ be the length of _searchValue_. @@ -1896,15 +1893,14 @@

NumberBitwiseOp ( - _op_: a sequence of Unicode code points, - _x_: unknown, - _y_: unknown, + _op_: `&`, `^`, or `|`, + _x_: a Number, + _y_: a Number, )

- 1. Assert: _op_ is `&`, `^`, or `|`. 1. Let _lnum_ be ! ToInt32(_x_). 1. Let _rnum_ be ! ToInt32(_y_). 1. Let _lbits_ be the 32-bit two's complement bit string representing ℝ(_lnum_). @@ -2253,15 +2249,13 @@

BinaryAnd ( - _x_: unknown, - _y_: unknown, + _x_: 0 or 1, + _y_: 0 or 1, )

- 1. Assert: _x_ is 0 or 1. - 1. Assert: _y_ is 0 or 1. 1. If _x_ is 1 and _y_ is 1, return 1. 1. Else, return 0. @@ -2270,15 +2264,13 @@

BinaryOr ( - _x_: unknown, - _y_: unknown, + _x_: 0 or 1, + _y_: 0 or 1, )

- 1. Assert: _x_ is 0 or 1. - 1. Assert: _y_ is 0 or 1. 1. If _x_ is 1 or _y_ is 1, return 1. 1. Else, return 0. @@ -2287,15 +2279,13 @@

BinaryXor ( - _x_: unknown, - _y_: unknown, + _x_: 0 or 1, + _y_: 0 or 1, )

- 1. Assert: _x_ is 0 or 1. - 1. Assert: _y_ is 0 or 1. 1. If _x_ is 1 and _y_ is 0, return 1. 1. Else if _x_ is 0 and _y_ is 1, return 1. 1. Else, return 0. @@ -2305,7 +2295,7 @@

BigIntBitwiseOp ( - _op_: a sequence of Unicode code points, + _op_: `&`, `^`, or `|`, _x_: a BigInt, _y_: a BigInt, ) @@ -2313,7 +2303,6 @@

- 1. Assert: _op_ is `&`, `^`, or `|`. 1. Set _x_ to ℝ(_x_). 1. Set _y_ to ℝ(_y_). 1. Let _result_ be 0. @@ -4022,13 +4011,12 @@

The Reference Record Specification Type

IsPropertyReference ( - _V_: unknown, + _V_: a Reference Record, )

- 1. Assert: _V_ is a Reference Record. 1. If _V_.[[Base]] is ~unresolvable~, return *false*. 1. If _V_.[[Base]] is an Environment Record, return *false*; otherwise return *true*. @@ -4037,13 +4025,12 @@

IsUnresolvableReference ( - _V_: unknown, + _V_: a Reference Record, )

- 1. Assert: _V_ is a Reference Record. 1. If _V_.[[Base]] is ~unresolvable~, return *true*; otherwise return *false*.
@@ -4051,13 +4038,12 @@

IsSuperReference ( - _V_: unknown, + _V_: a Reference Record, )

- 1. Assert: _V_ is a Reference Record. 1. If _V_.[[ThisValue]] is not ~empty~, return *true*; otherwise return *false*.
@@ -4065,13 +4051,12 @@

IsPrivateReference ( - _V_: unknown, + _V_: a Reference Record, )

- 1. Assert: _V_ is a Reference Record. 1. If _V_.[[ReferencedName]] is a Private Name, return *true*; otherwise return *false*.
@@ -4320,7 +4305,6 @@

- 1. Assert: _Desc_ is a Property Descriptor. 1. Let _like_ be the Record { [[Value]]: *undefined*, [[Writable]]: *false*, [[Get]]: *undefined*, [[Set]]: *undefined*, [[Enumerable]]: *false*, [[Configurable]]: *false* }. 1. If IsGenericDescriptor(_Desc_) is *true* or IsDataDescriptor(_Desc_) is *true*, then 1. If _Desc_ does not have a [[Value]] field, set _Desc_.[[Value]] to _like_.[[Value]]. @@ -4367,13 +4351,12 @@

Data Blocks

CreateByteDataBlock ( - _size_: an integer, + _size_: a non-negative integer, )

- 1. Assert: _size_ ≥ 0. 1. Let _db_ be a new Data Block value consisting of _size_ bytes. If it is impossible to create such a Data Block, throw a *RangeError* exception. 1. Set all of the bytes of _db_ to 0. 1. Return _db_. @@ -4389,7 +4372,6 @@

- 1. Assert: _size_ ≥ 0. 1. Let _db_ be a new Shared Data Block value consisting of _size_ bytes. If it is impossible to create such a Shared Data Block, throw a *RangeError* exception. 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. 1. Let _eventList_ be the [[EventList]] field of the element in _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). @@ -4403,9 +4385,9 @@

CopyDataBlockBytes ( - _toBlock_: unknown, + _toBlock_: a Data Block or a Shared Data Block, _toIndex_: a non-negative integer, - _fromBlock_: unknown, + _fromBlock_: a Data Block or a Shared Data Block, _fromIndex_: a non-negative integer, _count_: a non-negative integer, ) @@ -4413,7 +4395,7 @@

- 1. Assert: _fromBlock_ and _toBlock_ are distinct Data Block or Shared Data Block values. + 1. Assert: _fromBlock_ and _toBlock_ are distinct values. 1. Let _fromSize_ be the number of bytes in _fromBlock_. 1. Assert: _fromIndex_ + _count_ ≤ _fromSize_. 1. Let _toSize_ be the number of bytes in _toBlock_. @@ -4602,8 +4584,8 @@

Type Conversion

ToPrimitive ( - _input_: unknown, - optional _preferredType_: unknown, + _input_: an ECMAScript language value, + optional _preferredType_: ~string~ or ~number~, )

@@ -4611,7 +4593,6 @@

It converts its _input_ argument to a non-Object type. If an object is capable of converting to more than one primitive type, it may use the optional hint _preferredType_ to favour that type.

- 1. Assert: _input_ is an ECMAScript language value. 1. If Type(_input_) is Object, then 1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive). 1. If _exoticToPrim_ is not *undefined*, then @@ -4634,15 +4615,13 @@

OrdinaryToPrimitive ( - _O_: unknown, - _hint_: unknown, + _O_: an Object, + _hint_: ~string~ or ~number~, )

- 1. Assert: Type(_O_) is Object. - 1. Assert: _hint_ is either ~string~ or ~number~. 1. If _hint_ is ~string~, then 1. Let _methodNames_ be « *"toString"*, *"valueOf"* ». 1. Else, @@ -5572,7 +5551,7 @@

CanonicalNumericIndexString ( - _argument_: unknown, + _argument_: a String, )

@@ -5580,7 +5559,6 @@

It returns _argument_ converted to a Number value if it is a String representation of a Number that would be produced by ToString, or the string *"-0"*. Otherwise, it returns *undefined*.

- 1. Assert: Type(_argument_) is String. 1. If _argument_ is *"-0"*, return *-0*𝔽. 1. Let _n_ be ! ToNumber(_argument_). 1. If SameValue(! ToString(_n_), _argument_) is *false*, return *undefined*. @@ -5769,7 +5747,6 @@

It returns a completion record which, if its [[Type]] is ~normal~, has a [[Value]] which is a Boolean. It is used to determine whether additional properties can be added to _O_.
- 1. Assert: Type(_O_) is Object. 1. Return ? _O_.[[IsExtensible]](). @@ -5838,8 +5815,6 @@

It determines if _p_ is a prefix of _q_.
- 1. Assert: Type(_p_) is String. - 1. Assert: Type(_q_) is String. 1. If _q_ can be the string-concatenation of _p_ and some other String _r_, return *true*. Otherwise, return *false*. @@ -5894,8 +5869,8 @@

SameValueNonNumeric ( - _x_: an ECMAScript language value, - _y_: an ECMAScript language value, + _x_: an ECMAScript language value, but not a Number or a BigInt, + _y_: an ECMAScript language value, but not a Number or a BigInt, )

@@ -5903,7 +5878,6 @@

It returns a completion record whose [[Type]] is ~normal~ and whose [[Value]] is a Boolean.

- 1. Assert: Type(_x_) is not Number or BigInt. 1. Assert: Type(_x_) is the same as Type(_y_). 1. If Type(_x_) is Undefined, return *true*. 1. If Type(_x_) is Null, return *true*. @@ -6035,7 +6009,7 @@

Operations on Objects

MakeBasicObject ( - _internalSlotsList_: unknown, + _internalSlotsList_: a List of internal slot names, )

@@ -6044,7 +6018,6 @@

- 1. Assert: _internalSlotsList_ is a List of internal slot names. 1. Let _obj_ be a newly created object with an internal slot for each name in _internalSlotsList_. 1. Set _obj_'s essential internal methods to the default ordinary object definitions specified in . 1. Assert: If the caller will not be overriding both _obj_'s [[GetPrototypeOf]] and [[SetPrototypeOf]] essential internal methods, then _internalSlotsList_ contains [[Prototype]]. @@ -6070,8 +6043,6 @@

It is used to retrieve the value of a specific property of an object.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Return ? _O_.[[Get]](_P_, _O_). @@ -6088,7 +6059,6 @@

It is used to retrieve the value of a specific property of an ECMAScript language value. If the value is not an object, the property lookup is performed using a wrapper object appropriate for the type of the value.
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _O_ be ? ToObject(_V_). 1. Return ? _O_.[[Get]](_P_, _V_). @@ -6108,9 +6078,6 @@

It is used to set the value of a specific property of an object. _V_ is the new value for the property.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Assert: Type(_Throw_) is Boolean. 1. Let _success_ be ? _O_.[[Set]](_P_, _V_, _O_). 1. If _success_ is *false* and _Throw_ is *true*, throw a *TypeError* exception. 1. Return _success_. @@ -6130,8 +6097,6 @@

It is used to create a new own property of an object.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_). @@ -6153,8 +6118,6 @@

It is used to create a new own property of an object.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_). @@ -6176,8 +6139,6 @@

It is used to create a new own property of an object. It throws a *TypeError* exception if the requested property update cannot be performed.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _success_ be ? CreateDataProperty(_O_, _P_, _V_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return _success_. @@ -6200,8 +6161,6 @@

It is used to call the [[DefineOwnProperty]] internal method of an object in a manner that will throw a *TypeError* exception if the requested property update cannot be performed.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _success_ be ? _O_.[[DefineOwnProperty]](_P_, _desc_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return _success_. @@ -6220,8 +6179,6 @@

It is used to remove a specific own property of an object. It throws an exception if the property is not configurable.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _success_ be ? _O_.[[Delete]](_P_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return _success_. @@ -6240,7 +6197,6 @@

It is used to get the value of a specific property of an ECMAScript language value when the value of the property is expected to be a function.
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _func_ be ? GetV(_V_, _P_). 1. If _func_ is either *undefined* or *null*, return *undefined*. 1. If IsCallable(_func_) is *false*, throw a *TypeError* exception. @@ -6260,8 +6216,6 @@

It returns a completion record which, if its [[Type]] is ~normal~, has a [[Value]] which is a Boolean. It is used to determine whether an object has a property with the specified property key. The property may be either an own or inherited.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Return ? _O_.[[HasProperty]](_P_). @@ -6278,8 +6232,6 @@

It returns a completion record which, if its [[Type]] is ~normal~, has a [[Value]] which is a Boolean. It is used to determine whether an object has an own property with the specified property key.
- 1. Assert: Type(_O_) is Object. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, return *false*. 1. Return *true*. @@ -6308,9 +6260,9 @@

Construct ( - _F_: a function object, + _F_: a constructor, optional _argumentsList_: unknown, - optional _newTarget_: unknown, + optional _newTarget_: a constructor, )

@@ -6320,8 +6272,6 @@

1. If _newTarget_ is not present, set _newTarget_ to _F_. 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. - 1. Assert: IsConstructor(_F_) is *true*. - 1. Assert: IsConstructor(_newTarget_) is *true*. 1. Return ? _F_.[[Construct]](_argumentsList_, _newTarget_). @@ -6332,8 +6282,8 @@

SetIntegrityLevel ( - _O_: unknown, - _level_: unknown, + _O_: an Object, + _level_: ~sealed~ or ~frozen~, )

@@ -6341,8 +6291,6 @@

It is used to fix the set of own properties of an object.

- 1. Assert: Type(_O_) is Object. - 1. Assert: _level_ is either ~sealed~ or ~frozen~. 1. Let _status_ be ? _O_.[[PreventExtensions]](). 1. If _status_ is *false*, return *false*. 1. Let _keys_ be ? _O_.[[OwnPropertyKeys]](). @@ -6366,8 +6314,8 @@

TestIntegrityLevel ( - _O_: unknown, - _level_: unknown, + _O_: an Object, + _level_: ~sealed~ or ~frozen~, )

@@ -6375,8 +6323,6 @@

It is used to determine if the set of own properties of an object are fixed.

- 1. Assert: Type(_O_) is Object. - 1. Assert: _level_ is either ~sealed~ or ~frozen~. 1. Let _extensible_ be ? IsExtensible(_O_). 1. If _extensible_ is *true*, return *false*. 1. NOTE: If the object is extensible, none of its properties are examined. @@ -6394,7 +6340,7 @@

CreateArrayFromList ( - _elements_: a List, + _elements_: a List of ECMAScript language values, )

@@ -6402,7 +6348,6 @@

It is used to create an Array whose elements are provided by _elements_.

- 1. Assert: _elements_ is a List whose elements are all ECMAScript language values. 1. Let _array_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. For each element _e_ of _elements_, do @@ -6415,7 +6360,7 @@

LengthOfArrayLike ( - _obj_: unknown, + _obj_: an Object, )

@@ -6423,7 +6368,6 @@

It returns the value of the *"length"* property of an array-like object (as a non-negative integer).

- 1. Assert: Type(_obj_) is Object. 1. Return ℝ(? ToLength(? Get(_obj_, *"length"*))).

An array-like object is any object for which this operation returns an integer rather than an abrupt completion.

@@ -6476,7 +6420,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. 1. Let _func_ be ? GetV(_V_, _P_). 1. Return ? Call(_func_, _V_, _argumentsList_). @@ -6521,7 +6464,6 @@

It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor @@species property cannot be found starting from _O_.
- 1. Assert: Type(_O_) is Object. 1. Let _C_ be ? Get(_O_, *"constructor"*). 1. If _C_ is *undefined*, return _defaultConstructor_. 1. If Type(_C_) is not Object, throw a *TypeError* exception. @@ -6536,13 +6478,12 @@

EnumerableOwnPropertyNames ( _O_: an Object, - _kind_: one of ~key~, ~value~, or ~key+value~, + _kind_: ~key~, ~value~, or ~key+value~, )

- 1. Assert: Type(_O_) is Object. 1. Let _ownKeys_ be ? _O_.[[OwnPropertyKeys]](). 1. Let _properties_ be a new empty List. 1. For each element _key_ of _ownKeys_, do @@ -6564,13 +6505,12 @@

GetFunctionRealm ( - _obj_: unknown, + _obj_: a function object, )

- 1. Assert: ! IsCallable(_obj_) is *true*. 1. If _obj_ has a [[Realm]] internal slot, then 1. Return _obj_.[[Realm]]. 1. If _obj_ is a bound function exotic object, then @@ -6590,16 +6530,14 @@

CopyDataProperties ( - _target_: unknown, - _source_: unknown, - _excludedItems_: unknown, + _target_: an Object, + _source_: an ECMAScript language value, + _excludedItems_: a List of property keys, )

- 1. Assert: Type(_target_) is Object. - 1. Assert: _excludedItems_ is a List of property keys. 1. If _source_ is *undefined* or *null*, return _target_. 1. Let _from_ be ! ToObject(_source_). 1. Let _keys_ be ? _from_.[[OwnPropertyKeys]](). @@ -6769,7 +6707,7 @@

Operations on Iterator Objects

GetIterator ( _obj_: unknown, - optional _hint_: unknown, + optional _hint_: ~sync~ or ~async~, optional _method_: unknown, )

@@ -6777,7 +6715,6 @@

1. If _hint_ is not present, set _hint_ to ~sync~. - 1. Assert: _hint_ is either ~sync~ or ~async~. 1. If _method_ is not present, then 1. If _hint_ is ~async~, then 1. Set _method_ to ? GetMethod(_obj_, @@asyncIterator). @@ -6816,13 +6753,12 @@

IteratorComplete ( - _iterResult_: unknown, + _iterResult_: an Object, )

- 1. Assert: Type(_iterResult_) is Object. 1. Return ! ToBoolean(? Get(_iterResult_, *"done"*)).
@@ -6830,13 +6766,12 @@

IteratorValue ( - _iterResult_: unknown, + _iterResult_: an Object, )

- 1. Assert: Type(_iterResult_) is Object. 1. Return ? Get(_iterResult_, *"value"*).
@@ -6863,7 +6798,7 @@

IteratorClose ( _iteratorRecord_: unknown, - _completion_: unknown, + _completion_: a Completion Record, )

@@ -6872,7 +6807,6 @@

1. Assert: Type(_iteratorRecord_.[[Iterator]]) is Object. - 1. Assert: _completion_ is a Completion Record. 1. Let _iterator_ be _iteratorRecord_.[[Iterator]]. 1. Let _innerResult_ be GetMethod(_iterator_, *"return"*). 1. If _innerResult_.[[Type]] is ~normal~, then @@ -6890,7 +6824,7 @@

AsyncIteratorClose ( _iteratorRecord_: unknown, - _completion_: unknown, + _completion_: a Completion Record, )

@@ -6899,7 +6833,6 @@

1. Assert: Type(_iteratorRecord_.[[Iterator]]) is Object. - 1. Assert: _completion_ is a Completion Record. 1. Let _iterator_ be _iteratorRecord_.[[Iterator]]. 1. Let _innerResult_ be GetMethod(_iterator_, *"return"*). 1. If _innerResult_.[[Type]] is ~normal~, then @@ -6918,15 +6851,14 @@

CreateIterResultObject ( _value_: unknown, - _done_: unknown, + _done_: a Boolean, )

description
-
It creates an object that supports the IteratorResult interface.
+
It creates an object that conforms to the IteratorResult interface.
- 1. Assert: Type(_done_) is Boolean. 1. Let _obj_ be ! OrdinaryObjectCreate(%Object.prototype%). 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"value"*, _value_). 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"done"*, _done_). @@ -8806,7 +8738,7 @@

Static Semantics: IsFunctionDefinition

Static Semantics: IsAnonymousFunctionDefinition ( - _expr_: a Parse Node for |AssignmentExpression| or a Parse Node for |Initializer|, + _expr_: an |AssignmentExpression| Parse Node or an |Initializer| Parse Node, )

@@ -9200,7 +9132,7 @@

Runtime Semantics: BindingInitialization

InitializeBoundName ( - _name_: unknown, + _name_: a String, _value_: unknown, _environment_: unknown, ) @@ -9208,7 +9140,6 @@

- 1. Assert: Type(_name_) is String. 1. If _environment_ is not *undefined*, then 1. Perform _environment_.InitializeBinding(_name_, _value_). 1. Return NormalCompletion(*undefined*). @@ -11015,7 +10946,6 @@

1. Assert: _envRec_ does not already have a binding for _N_. - 1. Assert: _M_ is a Module Record. 1. Assert: When _M_.[[Environment]] is instantiated it will have a direct binding for _N2_. 1. Create an immutable indirect binding in _envRec_ for _N_ that references _M_ and _N2_ as its target binding and record that the binding is initialized. 1. Return NormalCompletion(~empty~). @@ -11087,15 +11017,13 @@

NewFunctionEnvironment ( - _F_: unknown, - _newTarget_: unknown, + _F_: an ECMAScript function, + _newTarget_: an Object or *undefined*, )

- 1. Assert: _F_ is an ECMAScript function. - 1. Assert: Type(_newTarget_) is Undefined or Object. 1. Let _env_ be a new function Environment Record containing no bindings. 1. Set _env_.[[FunctionObject]] to _F_. 1. If _F_.[[ThisMode]] is ~lexical~, set _env_.[[ThisBindingStatus]] to ~lexical~. @@ -11345,7 +11273,7 @@

SetRealmGlobalObject ( _realmRec_: unknown, - _globalObj_: unknown, + _globalObj_: an Object or *undefined*, _thisValue_: unknown, )

@@ -11520,7 +11448,7 @@

GetActiveScriptOrModule ( )

ResolveBinding ( _name_: a String, - optional _env_: an Environment Record, + optional _env_: an Environment Record or *undefined*, )

@@ -11700,7 +11628,6 @@

The default implementation of HostMakeJobCallback performs the following steps when called:

- 1. Assert: IsCallable(_callback_) is *true*. 1. Return the JobCallback Record { [[Callback]]: _callback_, [[HostDefined]]: ~empty~ }.

ECMAScript hosts that are not web browsers must use the default implementation of HostMakeJobCallback.

@@ -12171,13 +12098,12 @@

OrdinarySetPrototypeOf ( _O_: an Object, - _V_: an ECMAScript language value, + _V_: an Object or *null*, )

- 1. Assert: Either Type(_V_) is Object or Type(_V_) is Null. 1. Let _current_ be _O_.[[Prototype]]. 1. If SameValue(_V_, _current_) is *true*, return *true*. 1. Let _extensible_ be _O_.[[Extensible]]. @@ -12272,7 +12198,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If _O_ does not have an own property with key _P_, return *undefined*. 1. Let _D_ be a newly created Property Descriptor with no fields. 1. Let _X_ be _O_'s own property whose key is _P_. @@ -12418,7 +12343,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _hasOwn_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _hasOwn_ is not *undefined*, return *true*. 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). @@ -12457,7 +12381,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, then 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). @@ -12501,7 +12424,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _ownDesc_ be ? _O_.[[GetOwnProperty]](_P_). 1. Return OrdinarySetWithOwnDescriptor(_O_, _P_, _V_, _Receiver_, _ownDesc_). @@ -12521,7 +12443,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If _ownDesc_ is *undefined*, then 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). 1. If _parent_ is not *null*, then @@ -12573,7 +12494,6 @@

- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, return *true*. 1. If _desc_.[[Configurable]] is *true*, then @@ -12644,7 +12564,7 @@

OrdinaryCreateFromConstructor ( _constructor_: unknown, - _intrinsicDefaultProto_: unknown, + _intrinsicDefaultProto_: a String, optional _internalSlotsList_: a List of names of internal slots, )

@@ -12653,7 +12573,7 @@

It creates an ordinary object whose [[Prototype]] value is retrieved from a constructor's *"prototype"* property, if it exists. Otherwise the intrinsic named by _intrinsicDefaultProto_ is used for [[Prototype]]. _internalSlotsList_ contains the names of additional internal slots that must be defined as part of the object. If _internalSlotsList_ is not provided, a new empty List is used.
- 1. Assert: _intrinsicDefaultProto_ is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object. + 1. Assert: _intrinsicDefaultProto_ is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object. 1. Let _proto_ be ? GetPrototypeFromConstructor(_constructor_, _intrinsicDefaultProto_). 1. Return ! OrdinaryObjectCreate(_proto_, _internalSlotsList_). @@ -12662,8 +12582,8 @@

GetPrototypeFromConstructor ( - _constructor_: unknown, - _intrinsicDefaultProto_: unknown, + _constructor_: a function object, + _intrinsicDefaultProto_: a String, )

@@ -12671,8 +12591,7 @@

It determines the [[Prototype]] value that should be used to create an object corresponding to a specific constructor. The value is retrieved from the constructor's *"prototype"* property, if it exists. Otherwise the intrinsic named by _intrinsicDefaultProto_ is used for [[Prototype]].

- 1. Assert: _intrinsicDefaultProto_ is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object. - 1. Assert: IsCallable(_constructor_) is *true*. + 1. Assert: _intrinsicDefaultProto_ is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object. 1. Let _proto_ be ? Get(_constructor_, *"prototype"*). 1. If Type(_proto_) is not Object, then 1. Let _realm_ be ? GetFunctionRealm(_constructor_). @@ -12902,7 +12821,6 @@

an ECMAScript function object _F_
- 1. Assert: _F_ is an ECMAScript function object. 1. Let _callerContext_ be the running execution context. 1. Let _calleeContext_ be PrepareForOrdinaryCall(_F_, *undefined*). 1. Assert: _calleeContext_ is now the running execution context. @@ -12926,13 +12844,12 @@

PrepareForOrdinaryCall ( _F_: a function object, - _newTarget_: an ECMAScript language value, + _newTarget_: an Object or *undefined*, )

- 1. Assert: Type(_newTarget_) is Undefined or Object. 1. Let _callerContext_ be the running execution context. 1. Let _calleeContext_ be a new ECMAScript code execution context. 1. Set the Function of _calleeContext_ to _F_. @@ -13059,8 +12976,6 @@

an ECMAScript function object _F_
- 1. Assert: _F_ is an ECMAScript function object. - 1. Assert: Type(_newTarget_) is Object. 1. Let _callerContext_ be the running execution context. 1. Let _kind_ be _F_.[[ConstructorKind]]. 1. If _kind_ is ~base~, then @@ -13102,7 +13017,6 @@

_sourceText_ is the source text of the syntactic definition of the function to be created.
- 1. Assert: Type(_functionPrototype_) is Object. 1. Let _internalSlotsList_ be the internal slots listed in . 1. Let _F_ be ! OrdinaryObjectCreate(_functionPrototype_, _internalSlotsList_). 1. Set _F_.[[Call]] to the definition specified in . @@ -13160,7 +13074,7 @@

%ThrowTypeError% ( )

MakeConstructor ( - _F_: a function object, + _F_: an ECMAScript function object or a built-in function object, optional _writablePrototype_: a Boolean, optional _prototype_: an Object, ) @@ -13170,7 +13084,6 @@

It converts _F_ into a constructor.
- 1. Assert: _F_ is an ECMAScript function object or a built-in function object. 1. If _F_ is an ECMAScript function object, then 1. Assert: IsConstructor(_F_) is *false*. 1. Assert: _F_ is an extensible object that does not have a *"prototype"* own property. @@ -13190,13 +13103,12 @@

MakeClassConstructor ( - _F_: unknown, + _F_: an ECMAScript function object, )

- 1. Assert: _F_ is an ECMAScript function object. 1. Assert: _F_.[[IsClassConstructor]] is *false*. 1. Set _F_.[[IsClassConstructor]] to *true*. 1. Return NormalCompletion(*undefined*). @@ -13206,8 +13118,8 @@

MakeMethod ( - _F_: unknown, - _homeObject_: unknown, + _F_: an ECMAScript function object, + _homeObject_: an Object, )

@@ -13215,8 +13127,6 @@

It configures _F_ as a method.

- 1. Assert: _F_ is an ECMAScript function object. - 1. Assert: Type(_homeObject_) is Object. 1. Set _F_.[[HomeObject]] to _homeObject_. 1. Return NormalCompletion(*undefined*). @@ -13489,7 +13399,7 @@

CreateBuiltinFunction ( - _behaviour_: unknown, + _behaviour_: an Abstract Closure, a set of algorithm steps, or some other definition of a function's behaviour provided in this specification, _length_: a non-negative integer or +∞, _name_: a property key, _additionalInternalSlotsList_: a List of names of internal slots, @@ -13503,9 +13413,7 @@

_additionalInternalSlotsList_ contains the names of additional internal slots that must be defined as part of the object. This operation creates a built-in function object.
- 1. Assert: _behaviour_ is either an Abstract Closure, a set of algorithm steps, or some other definition of a function's behaviour provided in this specification. 1. If _realm_ is not present, set _realm_ to the current Realm Record. - 1. Assert: _realm_ is a Realm Record. 1. If _prototype_ is not present, set _prototype_ to _realm_.[[Intrinsics]].[[%Function.prototype%]]. 1. Let _internalSlotsList_ be a List containing the names of all the internal slots that requires for the built-in function object that is about to be created. 1. Append to _internalSlotsList_ the elements of _additionalInternalSlotsList_. @@ -13631,9 +13539,9 @@

BoundFunctionCreate ( - _targetFunction_: unknown, - _boundThis_: unknown, - _boundArgs_: unknown, + _targetFunction_: a function object, + _boundThis_: an ECMAScript language value, + _boundArgs_: a List of ECMAScript language values, )

@@ -13641,7 +13549,6 @@

It is used to specify the creation of new bound function exotic objects.

- 1. Assert: Type(_targetFunction_) is Object. 1. Let _proto_ be ? _targetFunction_.[[GetPrototypeOf]](). 1. Let _internalSlotsList_ be the internal slots listed in , plus [[Prototype]] and [[Extensible]]. 1. Let _obj_ be ! MakeBasicObject(_internalSlotsList_). @@ -13678,7 +13585,6 @@

an Array exotic object _A_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If _P_ is *"length"*, then 1. Return ? ArraySetLength(_A_, _Desc_). 1. Else if _P_ is an array index, then @@ -13822,7 +13728,6 @@

a String exotic object _S_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _desc_ be OrdinaryGetOwnProperty(_S_, _P_). 1. If _desc_ is not *undefined*, return _desc_. 1. Return ! StringGetOwnProperty(_S_, _P_). @@ -13841,7 +13746,6 @@

a String exotic object _S_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _stringDesc_ be ! StringGetOwnProperty(_S_, _P_). 1. If _stringDesc_ is not *undefined*, then 1. Let _extensible_ be _S_.[[Extensible]]. @@ -13900,15 +13804,13 @@

StringGetOwnProperty ( - _S_: unknown, - _P_: unknown, + _S_: an Object that has a [[StringData]] internal slot, + _P_: a property key, )

- 1. Assert: _S_ is an Object that has a [[StringData]] internal slot. - 1. Assert: IsPropertyKey(_P_) is *true*. 1. If Type(_P_) is not String, return *undefined*. 1. Let _index_ be ! CanonicalNumericIndexString(_P_). 1. If _index_ is *undefined*, return *undefined*. @@ -14202,8 +14104,6 @@

an Integer-Indexed exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If Type(_P_) is String, then 1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then @@ -14225,8 +14125,6 @@

an Integer-Indexed exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If Type(_P_) is String, then 1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, return ! IsValidIntegerIndex(_O_, _numericIndex_). @@ -14246,8 +14144,6 @@

an Integer-Indexed exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If Type(_P_) is String, then 1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then @@ -14274,7 +14170,6 @@

an Integer-Indexed exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If Type(_P_) is String, then 1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then @@ -14296,7 +14191,6 @@

an Integer-Indexed exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If Type(_P_) is String, then 1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then @@ -14317,8 +14211,6 @@

an Integer-Indexed exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If Type(_P_) is String, then 1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then @@ -14335,7 +14227,6 @@

[[OwnPropertyKeys]] ( )

1. Let _keys_ be a new empty List. - 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *false*, then 1. For each integer _i_ starting with 0 such that _i_ < _O_.[[ArrayLength]], in ascending order, do 1. Add ! ToString(𝔽(_i_)) as the last element of _keys_. @@ -14375,14 +14266,13 @@

IsValidIntegerIndex ( - _O_: unknown, + _O_: an Integer-Indexed exotic object, _index_: a Number, )

- 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, return *false*. 1. If ! IsIntegralNumber(_index_) is *false*, return *false*. 1. If _index_ is *-0*𝔽, return *false*. @@ -14394,14 +14284,13 @@

IntegerIndexedElementGet ( - _O_: unknown, + _O_: an Integer-Indexed exotic object, _index_: a Number, )

- 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If ! IsValidIntegerIndex(_O_, _index_) is *false*, return *undefined*. 1. Let _offset_ be _O_.[[ByteOffset]]. 1. Let _arrayTypeName_ be the String value of _O_.[[TypedArrayName]]. @@ -14415,15 +14304,14 @@

IntegerIndexedElementSet ( - _O_: unknown, + _O_: an Integer-Indexed exotic object, _index_: a Number, - _value_: unknown, + _value_: an ECMAScript language value, )

- 1. Assert: _O_ is an Integer-Indexed exotic object. 1. If _O_.[[ContentType]] is ~BigInt~, let _numValue_ be ? ToBigInt(_value_). 1. Otherwise, let _numValue_ be ? ToNumber(_value_). 1. If ! IsValidIntegerIndex(_O_, _index_) is *true*, then @@ -14608,7 +14496,6 @@

a module namespace exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If Type(_P_) is Symbol, then 1. Return ? OrdinaryGet(_O_, _P_, _Receiver_). 1. Let _exports_ be _O_.[[Exports]]. @@ -14657,7 +14544,6 @@

a module namespace exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. If Type(_P_) is Symbol, then 1. Return ? OrdinaryDelete(_O_, _P_). 1. Let _exports_ be _O_.[[Exports]]. @@ -14682,8 +14568,8 @@

[[OwnPropertyKeys]] ( )

ModuleNamespaceCreate ( - _module_: unknown, - _exports_: unknown, + _module_: a Module Record, + _exports_: a List of Strings, )

@@ -14691,9 +14577,7 @@

It is used to specify the creation of new module namespace exotic objects.

- 1. Assert: _module_ is a Module Record. 1. Assert: _module_.[[Namespace]] is ~empty~. - 1. Assert: _exports_ is a List of String values. 1. Let _internalSlotsList_ be the internal slots listed in . 1. Let _M_ be ! MakeBasicObject(_internalSlotsList_). 1. Set _M_'s essential internal methods to the definitions specified in . @@ -14737,13 +14621,12 @@

SetImmutablePrototype ( _O_: unknown, - _V_: unknown, + _V_: an Object or *null*, )

- 1. Assert: Either Type(_V_) is Object or Type(_V_) is Null. 1. Let _current_ be ? _O_.[[GetPrototypeOf]](). 1. If SameValue(_V_, _current_) is *true*, return *true*. 1. Return *false*. @@ -14927,7 +14810,6 @@

a Proxy exotic object _O_
- 1. Assert: Either Type(_V_) is Object or Type(_V_) is Null. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15032,7 +14914,6 @@

a Proxy exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15098,7 +14979,6 @@

a Proxy exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15157,7 +15037,6 @@

a Proxy exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15202,7 +15081,6 @@

a Proxy exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15245,7 +15123,6 @@

a Proxy exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15290,7 +15167,6 @@

a Proxy exotic object _O_
- 1. Assert: IsPropertyKey(_P_) is *true*. 1. Let _handler_ be _O_.[[ProxyHandler]]. 1. If _handler_ is *null*, throw a *TypeError* exception. 1. Assert: Type(_handler_) is Object. @@ -15342,7 +15218,7 @@

[[OwnPropertyKeys]] ( )

1. If _trapResult_ contains any duplicate entries, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. Let _targetKeys_ be ? _target_.[[OwnPropertyKeys]](). - 1. Assert: _targetKeys_ is a List whose elements are only String and Symbol values. + 1. Assert: _targetKeys_ is a List of property keys. 1. Assert: _targetKeys_ contains no duplicate entries. 1. Let _targetConfigurableKeys_ be a new empty List. 1. Let _targetNonconfigurableKeys_ be a new empty List. @@ -18103,7 +17979,7 @@

Static Semantics: Early Errors

Static Semantics: IsValidRegularExpressionLiteral ( - _literal_: unknown, + _literal_: a |RegularExpressionLiteral| Parse Node, )

@@ -18111,7 +17987,6 @@

It determines if its argument is a valid regular expression literal.

- 1. Assert: _literal_ is a |RegularExpressionLiteral|. 1. If FlagText of _literal_ contains any code points other than `g`, `i`, `m`, `s`, `u`, or `y`, or if it contains the same code point more than once, return *false*. 1. Let _patternText_ be BodyText of _literal_. 1. If FlagText of _literal_ contains `u`, let _u_ be *true*; else let _u_ be *false*. @@ -18656,14 +18531,13 @@

EvaluatePropertyAccessWithIdentifierKey ( _baseValue_: an ECMAScript language value, - _identifierName_: a Parse Node, + _identifierName_: an |IdentifierName| Parse Node, _strict_: a Boolean, )

- 1. Assert: _identifierName_ is an |IdentifierName|. 1. Let _propertyNameString_ be StringValue of _identifierName_. 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameString_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. @@ -18686,15 +18560,13 @@

Runtime Semantics: Evaluation

EvaluateNew ( - _constructExpr_: unknown, - _arguments_: unknown, + _constructExpr_: a |NewExpression| Parse Node or a |MemberExpression| Parse Node, + _arguments_: ~empty~ or an |Arguments| Parse Node, )

- 1. Assert: _constructExpr_ is either a |NewExpression| or a |MemberExpression|. - 1. Assert: _arguments_ is either ~empty~ or an |Arguments|. 1. Let _ref_ be the result of evaluating _constructExpr_. 1. Let _constructor_ be ? GetValue(_ref_). 1. If _arguments_ is ~empty~, let _argList_ be a new empty List. @@ -20700,7 +20572,7 @@

Runtime Semantics: Evaluation

BlockDeclarationInstantiation ( _code_: a Parse Node, - _env_: an Environment Record, + _env_: a declarative Environment Record, )

@@ -20717,7 +20589,6 @@

#sec-web-compat-blockdeclarationinstantiation accordingly. --> - 1. Assert: _env_ is a declarative Environment Record. 1. Let _declarations_ be the LexicallyScopedDeclarations of _code_. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. For each element _d_ of _declarations_, do @@ -21707,13 +21578,12 @@

Runtime Semantics: Evaluation

EnumerateObjectProperties ( - _O_: unknown, + _O_: an Object, )

- 1. Assert: Type(_O_) is Object. 1. Return an Iterator object () whose `next` method iterates over all the String-valued keys of enumerable properties of _O_. The iterator object is never directly accessible to ECMAScript code. The mechanics and order of enumerating the properties is not specified but must conform to the rules specified below.

The iterator's `throw` and `return` methods are *null* and are never invoked. The iterator's `next` method processes object properties to determine whether the property key should be returned as an iterator value. Returned property keys do not include keys that are Symbols. Properties of the target object may be deleted during enumeration. A property that is deleted before it is processed by the iterator's `next` method is ignored. If new properties are added to the target object during enumeration, the newly added properties are not guaranteed to be processed in the active enumeration. A property name will be returned by the iterator's `next` method at most once in any enumeration.

@@ -21760,7 +21630,7 @@

For-In Iterator Objects

CreateForInIterator ( - _object_: unknown, + _object_: an Object, )

@@ -21768,7 +21638,6 @@

It is used to create a For-In Iterator object which iterates over the own and inherited enumerable string properties of _object_ in a specific order.

- 1. Assert: Type(_object_) is Object. 1. Let _iterator_ be ! OrdinaryObjectCreate(%ForInIteratorPrototype%, « [[Object]], [[ObjectWasVisited]], [[VisitedKeys]], [[RemainingKeys]] »). 1. Set _iterator_.[[Object]] to _object_. 1. Set _iterator_.[[ObjectWasVisited]] to *false*. @@ -22119,7 +21988,7 @@

Runtime Semantics: CaseBlockEvaluation

CaseClauseIsSelected ( - _C_: a Parse Node for |CaseClause|, + _C_: a |CaseClause| Parse Node, _input_: an ECMAScript language value, )

@@ -24557,13 +24426,12 @@

Tail Position Calls

Static Semantics: IsInTailPosition ( - _call_: unknown, + _call_: a Parse Node, )

- 1. Assert: _call_ is a Parse Node. 1. If the source code matching _call_ is non-strict code, return *false*. 1. If _call_ is not contained within a |FunctionBody|, |ConciseBody|, or |AsyncConciseBody|, return *false*. 1. Let _body_ be the |FunctionBody|, |ConciseBody|, or |AsyncConciseBody| that most closely contains _call_. @@ -25046,7 +24914,7 @@

Script Records

ParseScript ( - _sourceText_: unknown, + _sourceText_: ECMAScript source text, _realm_: unknown, _hostDefined_: unknown, ) @@ -25057,7 +24925,6 @@

- 1. Assert: _sourceText_ is an ECMAScript source text (see clause ). 1. Let _body_ be ParseText(_sourceText_, |Script|). 1. If _body_ is a List of errors, return _body_. 1. Return Script Record { [[Realm]]: _realm_, [[ECMAScriptCode]]: _body_, [[HostDefined]]: _hostDefined_ }. @@ -25103,8 +24970,8 @@

GlobalDeclarationInstantiation ( - _script_: a Parse Node for |ScriptBody|, - _env_: an Environment Record, + _script_: a |ScriptBody| Parse Node, + _env_: a global Environment Record, )

@@ -25121,7 +24988,6 @@

#sec-web-compat-globaldeclarationinstantiation accordingly. --> - 1. Assert: _env_ is a global Environment Record. 1. Let _lexNames_ be the LexicallyDeclaredNames of _script_. 1. Let _varNames_ be the VarDeclaredNames of _script_. 1. For each element _name_ of _lexNames_, do @@ -26837,7 +26703,6 @@

It creates a Source Text Module Record based upon the result of parsing _sourceText_ as a |Module|.

- 1. Assert: _sourceText_ is an ECMAScript source text (see clause ). 1. Let _body_ be ParseText(_sourceText_, |Module|). 1. If _body_ is a List of errors, return _body_. 1. Let _requestedModules_ be the ModuleRequests of _body_. @@ -26874,7 +26739,7 @@

GetExportedNames ( - optional _exportStarSet_: unknown, + optional _exportStarSet_: a List of Source Text Module Records, )

@@ -26883,7 +26748,6 @@

1. If _exportStarSet_ is not present, set _exportStarSet_ to a new empty List. - 1. Assert: _exportStarSet_ is a List of Source Text Module Records. 1. If _exportStarSet_ contains _module_, then 1. Assert: We've reached the starting point of an `export *` circularity. 1. Return a new empty List. @@ -26913,7 +26777,7 @@

ResolveExport ( _exportName_: a String, - optional _resolveSet_: unknown, + optional _resolveSet_: a List of Records that have [[Module]] and [[ExportName]] fields, )

@@ -26929,7 +26793,6 @@

1. If _resolveSet_ is not present, set _resolveSet_ to a new empty List. - 1. Assert: _resolveSet_ is a List of Record { [[Module]], [[ExportName]] }. 1. For each Record { [[Module]], [[ExportName]] } _r_ of _resolveSet_, do 1. If _module_ and _r_.[[Module]] are the same Module Record and SameValue(_exportName_, _r_.[[ExportName]]) is *true*, then 1. Assert: This is a circular import request. @@ -27194,7 +27057,7 @@

GetModuleNamespace ( - _module_: unknown, + _module_: an instance of a concrete subclass of Module Record, )

@@ -27203,7 +27066,6 @@

- 1. Assert: _module_ is an instance of a concrete subclass of Module Record. 1. Assert: If _module_ is a Cyclic Module Record, then _module_.[[Status]] is not ~unlinked~. 1. Let _namespace_ be _module_.[[Namespace]]. 1. If _namespace_ is ~empty~, then @@ -28842,14 +28704,13 @@

Object.defineProperties ( _O_, _Properties_ )

ObjectDefineProperties ( - _O_: unknown, + _O_: an Object, _Properties_: unknown, )

- 1. Assert: Type(_O_) is Object. 1. Let _props_ be ? ToObject(_Properties_). 1. Let _keys_ be ? _props_.[[OwnPropertyKeys]](). 1. Let _descriptors_ be a new empty List. @@ -29948,13 +29809,12 @@

Symbol.prototype.toString ( )

SymbolDescriptiveString ( - _sym_: unknown, + _sym_: a Symbol, )

- 1. Assert: Type(_sym_) is Symbol. 1. Let _desc_ be _sym_'s [[Description]] value. 1. If _desc_ is *undefined*, set _desc_ to the empty String. 1. Assert: Type(_desc_) is String. @@ -32457,14 +32317,12 @@

Date.prototype.toString ( )

TimeString ( - _tv_: unknown, + _tv_: a Number, but not *NaN*, )

- 1. Assert: Type(_tv_) is Number. - 1. Assert: _tv_ is not *NaN*. 1. Let _hour_ be the String representation of HourFromTime(_tv_), formatted as a two-digit decimal number, padded to the left with the code unit 0x0030 (DIGIT ZERO) if necessary. 1. Let _minute_ be the String representation of MinFromTime(_tv_), formatted as a two-digit decimal number, padded to the left with the code unit 0x0030 (DIGIT ZERO) if necessary. 1. Let _second_ be the String representation of SecFromTime(_tv_), formatted as a two-digit decimal number, padded to the left with the code unit 0x0030 (DIGIT ZERO) if necessary. @@ -32475,14 +32333,12 @@

DateString ( - _tv_: unknown, + _tv_: a Number, but not *NaN*, )

- 1. Assert: Type(_tv_) is Number. - 1. Assert: _tv_ is not *NaN*. 1. Let _weekday_ be the Name of the entry in with the Number WeekDay(_tv_). 1. Let _month_ be the Name of the entry in with the Number MonthFromTime(_tv_). 1. Let _day_ be the String representation of DateFromTime(_tv_), formatted as a two-digit decimal number, padded to the left with the code unit 0x0030 (DIGIT ZERO) if necessary. @@ -32677,14 +32533,12 @@

TimeZoneString ( - _tv_: unknown, + _tv_: a Number, but not *NaN*, )

- 1. Assert: Type(_tv_) is Number. - 1. Assert: _tv_ is not *NaN*. 1. Let _offset_ be LocalTZA(_tv_, *true*). 1. If _offset_ ≥ *+0*𝔽, then 1. Let _offsetSign_ be *"+"*. @@ -32702,13 +32556,12 @@

ToDateString ( - _tv_: unknown, + _tv_: a Number, )

- 1. Assert: Type(_tv_) is Number. 1. If _tv_ is *NaN*, return *"Invalid Date"*. 1. Let _t_ be LocalTime(_tv_). 1. Return the string-concatenation of DateString(_t_), the code unit 0x0020 (SPACE), TimeString(_t_), and TimeZoneString(_tv_). @@ -33196,16 +33049,15 @@

String.prototype.padStart ( _maxLength_ [ , _fillString_ ] )

StringPad ( - _O_: unknown, - _maxLength_: unknown, - _fillString_: unknown, - _placement_: unknown, + _O_: an ECMAScript language value, + _maxLength_: an ECMAScript language value, + _fillString_: an ECMAScript language value, + _placement_: ~start~ or ~end~, )

- 1. Assert: _placement_ is ~start~ or ~end~. 1. Let _S_ be ? ToString(_O_). 1. Let _intMaxLength_ be ℝ(? ToLength(_maxLength_)). 1. Let _stringLength_ be the length of _S_. @@ -33279,24 +33131,20 @@

String.prototype.replace ( _searchValue_, _replaceValue_ )

GetSubstitution ( - _matched_: unknown, - _str_: unknown, + _matched_: a String, + _str_: a String, _position_: a non-negative integer, - _captures_: unknown, - _namedCaptures_: unknown, - _replacement_: unknown, + _captures_: a possibly empty List of Strings, + _namedCaptures_: an Object or *undefined*, + _replacement_: a String, )

- 1. Assert: Type(_matched_) is String. 1. Let _matchLength_ be the number of code units in _matched_. - 1. Assert: Type(_str_) is String. 1. Let _stringLength_ be the number of code units in _str_. 1. Assert: _position_ ≤ _stringLength_. - 1. Assert: _captures_ is a possibly empty List of Strings. - 1. Assert: Type(_replacement_) is String. 1. Let _tailPos_ be _position_ + _matchLength_. 1. Let _m_ be the number of elements in _captures_. 1. Let _result_ be the String value derived from _replacement_ by copying code unit elements from _replacement_ to _result_ while performing replacements as specified in . These `$` replacements are done left-to-right, and, once such a replacement is performed, the new replacement text is not subject to further replacements. @@ -33722,8 +33570,8 @@

String.prototype.trim ( )

TrimString ( - _string_: unknown, - _where_: unknown, + _string_: an ECMAScript language value, + _where_: ~start~, ~end~, or ~start+end~, )

@@ -34978,9 +34826,9 @@

- 1. Assert: _p_ is a List of Unicode code points that is identical to a List of Unicode code points that is a Unicode property name or property alias listed in the “Property name and aliases” column of or . + 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of or . 1. Let _c_ be the canonical property name of _p_ as given in the “Canonical property name” column of the corresponding row. - 1. Return the List of Unicode code points of _c_. + 1. Return the List of Unicode code points _c_.

Implementations must support the Unicode property names and aliases listed in and . To ensure interoperability, implementations must not support any other property names or aliases.

@@ -35002,10 +34850,10 @@

- 1. Assert: _p_ is a List of Unicode code points that is identical to a List of Unicode code points that is a canonical, unaliased Unicode property name listed in the “Canonical property name” column of . - 1. Assert: _v_ is a List of Unicode code points that is identical to a List of Unicode code points that is a property value or property value alias for Unicode property _p_ listed in the “Property value and aliases” column of or . + 1. Assert: _p_ is a canonical, unaliased Unicode property name listed in the “Canonical property name” column of . + 1. Assert: _v_ is a property value or property value alias for Unicode property _p_ listed in the “Property value and aliases” column of or . 1. Let _value_ be the canonical property value of _v_ as given in the “Canonical property value” column of the corresponding row. - 1. Return the List of Unicode code points of _value_. + 1. Return the List of Unicode code points _value_.

Implementations must support the Unicode property value names and aliases listed in and . To ensure interoperability, implementations must not support any other property value names or aliases.

@@ -35375,9 +35223,9 @@

RegExpInitialize ( - _obj_: unknown, - _pattern_: unknown, - _flags_: unknown, + _obj_: an Object, + _pattern_: an ECMAScript language value, + _flags_: an ECMAScript language value, )

@@ -35397,7 +35245,7 @@

1. Let _patternCharacters_ be a List whose elements are the code unit elements of _P_. 1. Let _parseResult_ be ParsePattern(_patternText_, _u_). 1. If _parseResult_ is a non-empty List of *SyntaxError* objects, throw a *SyntaxError* exception. - 1. Assert: _parseResult_ is a Parse Node for |Pattern|. + 1. Assert: _parseResult_ is a |Pattern| Parse Node. 1. Set _obj_.[[OriginalSource]] to _P_. 1. Set _obj_.[[OriginalFlags]] to _F_. 1. Set _obj_.[[RegExpMatcher]] to the Abstract Closure that evaluates _parseResult_ by applying the semantics provided in using _patternCharacters_ as the pattern's List of |SourceCharacter| values and _F_ as the flag parameters. @@ -35518,15 +35366,13 @@

RegExp.prototype.exec ( _string_ )

RegExpExec ( - _R_: unknown, - _S_: unknown, + _R_: an Object, + _S_: a String, )

- 1. Assert: Type(_R_) is Object. - 1. Assert: Type(_S_) is String. 1. Let _exec_ be ? Get(_R_, *"exec"*). 1. If IsCallable(_exec_) is *true*, then 1. Let _result_ be ? Call(_exec_, _R_, « _S_ »). @@ -35543,15 +35389,13 @@

RegExpBuiltinExec ( - _R_: unknown, - _S_: unknown, + _R_: an initialized RegExp instance, + _S_: a String, )

- 1. Assert: _R_ is an initialized RegExp instance. - 1. Assert: Type(_S_) is String. 1. Let _length_ be the number of code units in _S_. 1. Let _lastIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))). 1. Let _flags_ be _R_.[[OriginalFlags]]. @@ -36020,18 +35864,15 @@

RegExp String Iterator Objects

CreateRegExpStringIterator ( - _R_: unknown, - _S_: unknown, - _global_: unknown, - _fullUnicode_: unknown, + _R_: an Object, + _S_: a String, + _global_: a Boolean, + _fullUnicode_: a Boolean, )

- 1. Assert: Type(_S_) is String. - 1. Assert: Type(_global_) is Boolean. - 1. Assert: Type(_fullUnicode_) is Boolean. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _R_, _S_, _global_, and _fullUnicode_ and performs the following steps when called: 1. Repeat, 1. Let _match_ be ? RegExpExec(_R_, _S_). @@ -36554,8 +36395,8 @@

Array.prototype.flat ( [ _depth_ ] )

FlattenIntoArray ( - _target_: unknown, - _source_: unknown, + _target_: an Object, + _source_: an Object, _sourceLen_: a non-negative integer, _start_: a non-negative integer, _depth_: a non-negative integer or +∞, @@ -36566,8 +36407,6 @@

- 1. Assert: Type(_target_) is Object. - 1. Assert: Type(_source_) is Object. 1. Assert: If _mapperFunction_ is present, then ! IsCallable(_mapperFunction_) is *true*, _thisArg_ is present, and _depth_ is 1. 1. Let _targetIndex_ be _start_. 1. Let _sourceIndex_ be *+0*𝔽. @@ -37411,8 +37250,8 @@

Array Iterator Objects

CreateArrayIterator ( - _array_: unknown, - _kind_: unknown, + _array_: an Object, + _kind_: ~key+value~, ~key~, or ~value~, )

@@ -37420,8 +37259,6 @@

It is used to create iterator objects for Array methods that return such iterators.

- 1. Assert: Type(_array_) is Object. - 1. Assert: _kind_ is ~key+value~, ~key~, or ~value~. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _kind_ and _array_ and performs the following steps when called: 1. Let _index_ be 0. 1. Repeat, @@ -38333,7 +38170,6 @@

It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.

- 1. Assert: _source_ is an Object that has a [[TypedArrayName]] internal slot. 1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]]. 1. If IsDetachedBuffer(_targetBuffer_) is *true*, throw a *TypeError* exception. 1. Let _targetLength_ be _target_.[[ArrayLength]]. @@ -38383,7 +38219,7 @@

SetTypedArrayFromArrayLike ( _target_: a TypedArray, _targetOffset_: a non-negative integer or +∞, - _source_: an ECMAScript value other than a TypedArray, + _source_: an ECMAScript language value, but not a TypedArray, )

@@ -38391,7 +38227,6 @@

It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.

- 1. Assert: _source_ is any ECMAScript language value other than an Object with a [[TypedArrayName]] internal slot. 1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]]. 1. If IsDetachedBuffer(_targetBuffer_) is *true*, throw a *TypeError* exception. 1. Let _targetLength_ be _target_.[[ArrayLength]]. @@ -38606,7 +38441,7 @@

Abstract Operations for TypedArray Objects

TypedArraySpeciesCreate ( - _exemplar_: unknown, + _exemplar_: a TypedArray, _argumentList_: unknown, )

@@ -38615,7 +38450,6 @@

It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike ArraySpeciesCreate, which can create non-Array objects through the use of @@species, this operation enforces that the constructor function creates an actual TypedArray.

- 1. Assert: _exemplar_ is an Object that has [[TypedArrayName]] and [[ContentType]] internal slots. 1. Let _defaultConstructor_ be the intrinsic object listed in column one of for _exemplar_.[[TypedArrayName]]. 1. Let _constructor_ be ? SpeciesConstructor(_exemplar_, _defaultConstructor_). 1. Let _result_ be ? TypedArrayCreate(_constructor_, _argumentList_). @@ -38749,8 +38583,6 @@

- 1. Assert: _O_ is an Object that has a [[TypedArrayName]] internal slot. - 1. Assert: _srcArray_ is an Object that has a [[TypedArrayName]] internal slot. 1. Let _srcData_ be _srcArray_.[[ViewedArrayBuffer]]. 1. If IsDetachedBuffer(_srcData_) is *true*, throw a *TypeError* exception. 1. Let _constructorName_ be the String value of _O_.[[TypedArrayName]]. @@ -38792,7 +38624,7 @@

InitializeTypedArrayFromArrayBuffer ( _O_: a TypedArray, - _buffer_: an ArrayBuffer, + _buffer_: an ArrayBuffer or a SharedArrayBuffer, _byteOffset_: an ECMAScript language value, _length_: an ECMAScript language value, ) @@ -38800,8 +38632,6 @@

- 1. Assert: _O_ is an Object that has a [[TypedArrayName]] internal slot. - 1. Assert: _buffer_ is an Object that has an [[ArrayBufferData]] internal slot. 1. Let _constructorName_ be the String value of _O_.[[TypedArrayName]]. 1. Let _elementSize_ be the Element Size value specified in for _constructorName_. 1. Let _offset_ be ? ToIndex(_byteOffset_). @@ -38834,7 +38664,6 @@

- 1. Assert: _O_ is an Object that has a [[TypedArrayName]] internal slot. 1. Let _len_ be the number of elements in _values_. 1. Perform ? AllocateTypedArrayBuffer(_O_, _len_). 1. Let _k_ be 0. @@ -38851,13 +38680,12 @@

InitializeTypedArrayFromArrayLike ( _O_: a TypedArray, - _arrayLike_: an Object that is neither a TypedArray nor an ArrayBuffer, + _arrayLike_: an Object, but not a TypedArray or an ArrayBuffer, )

- 1. Assert: _O_ is an Object that has a [[TypedArrayName]] internal slot. 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). 1. Perform ? AllocateTypedArrayBuffer(_O_, _len_). 1. Let _k_ be 0. @@ -38881,7 +38709,6 @@

It allocates and associates an ArrayBuffer with _O_.

- 1. Assert: _O_ is an Object that has a [[ViewedArrayBuffer]] internal slot. 1. Assert: _O_.[[ViewedArrayBuffer]] is *undefined*. 1. Let _constructorName_ be the String value of _O_.[[TypedArrayName]]. 1. Let _elementSize_ be the Element Size value specified in for _constructorName_. @@ -38986,7 +38813,7 @@

Map ( [ _iterable_ ] )

AddEntriesFromIterable ( _target_: unknown, - _iterable_: unknown, + _iterable_: an ECMAScript language value, but not *undefined* or *null*, _adder_: a function object, )

@@ -38996,7 +38823,6 @@

1. If IsCallable(_adder_) is *false*, throw a *TypeError* exception. - 1. Assert: _iterable_ is present, and is neither *undefined* nor *null*. 1. Let _iteratorRecord_ be ? GetIterator(_iterable_). 1. Repeat, 1. Let _next_ be ? IteratorStep(_iteratorRecord_). @@ -39226,8 +39052,8 @@

Map Iterator Objects

CreateMapIterator ( - _map_: unknown, - _kind_: unknown, + _map_: an ECMAScript language value, + _kind_: ~key+value~, ~key~, or ~value~, )

@@ -39235,7 +39061,6 @@

It is used to create iterator objects for Map methods that return such iterators.

- 1. Assert: _kind_ is ~key+value~, ~key~, or ~value~. 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _map_ and _kind_ and performs the following steps when called: 1. Let _entries_ be the List that is _map_.[[MapData]]. @@ -39516,8 +39341,8 @@

Set Iterator Objects

CreateSetIterator ( - _set_: unknown, - _kind_: unknown, + _set_: an ECMAScript language value, + _kind_: ~key+value~ or ~value~, )

@@ -39525,7 +39350,6 @@

It is used to create iterator objects for Set methods that return such iterators.

- 1. Assert: _kind_ is ~key+value~ or ~value~. 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _set_ and _kind_ and performs the following steps when called: 1. Let _index_ be 0. @@ -39904,13 +39728,12 @@

IsDetachedBuffer ( - _arrayBuffer_: unknown, + _arrayBuffer_: an ArrayBuffer or a SharedArrayBuffer, )

- 1. Assert: Type(_arrayBuffer_) is Object and _arrayBuffer_ has an [[ArrayBufferData]] internal slot. 1. If _arrayBuffer_.[[ArrayBufferData]] is *null*, return *true*. 1. Return *false*. @@ -39919,14 +39742,13 @@

DetachArrayBuffer ( - _arrayBuffer_: unknown, + _arrayBuffer_: an ArrayBuffer, optional _key_: unknown, )

- 1. Assert: Type(_arrayBuffer_) is Object and _arrayBuffer_ has [[ArrayBufferData]], [[ArrayBufferByteLength]], and [[ArrayBufferDetachKey]] internal slots. 1. Assert: IsSharedArrayBuffer(_arrayBuffer_) is *false*. 1. If _key_ is not present, set _key_ to *undefined*. 1. If SameValue(_arrayBuffer_.[[ArrayBufferDetachKey]], _key_) is *false*, throw a *TypeError* exception. @@ -39942,7 +39764,7 @@

CloneArrayBuffer ( - _srcBuffer_: an ArrayBuffer, + _srcBuffer_: an ArrayBuffer or a SharedArrayBuffer, _srcByteOffset_: a non-negative integer, _srcLength_: a non-negative integer, _cloneConstructor_: a constructor, @@ -39953,8 +39775,6 @@

It creates a new ArrayBuffer whose data is a copy of _srcBuffer_'s data over the range starting at _srcByteOffset_ and continuing for _srcLength_ bytes.
- 1. Assert: Type(_srcBuffer_) is Object and _srcBuffer_ has an [[ArrayBufferData]] internal slot. - 1. Assert: IsConstructor(_cloneConstructor_) is *true*. 1. Let _targetBuffer_ be ? AllocateArrayBuffer(_cloneConstructor_, _srcLength_). 1. If IsDetachedBuffer(_srcBuffer_) is *true*, throw a *TypeError* exception. 1. Let _srcBlock_ be _srcBuffer_.[[ArrayBufferData]]. @@ -40127,7 +39947,7 @@

_type_: a TypedArray element type, _value_: a Number or a BigInt, _isTypedArray_: a Boolean, - _order_: one of ~SeqCst~, ~Unordered~, or ~Init~, + _order_: ~SeqCst~, ~Unordered~, or ~Init~, optional _isLittleEndian_: a Boolean, )

@@ -40354,7 +40174,7 @@

IsSharedArrayBuffer ( - _obj_: unknown, + _obj_: an ArrayBuffer or a SharedArrayBuffer, )

@@ -40362,7 +40182,6 @@

It tests whether an object is an ArrayBuffer, a SharedArrayBuffer, or a subtype of either.

- 1. Assert: Type(_obj_) is Object and _obj_ has an [[ArrayBufferData]] internal slot. 1. Let _bufferData_ be _obj_.[[ArrayBufferData]]. 1. If _bufferData_ is *null*, return *false*. 1. If _bufferData_ is a Data Block, return *false*. @@ -40933,14 +40752,13 @@

ValidateAtomicAccess ( - _typedArray_: unknown, + _typedArray_: a TypedArray, _requestIndex_: unknown, )

- 1. Assert: _typedArray_ is an Object that has a [[ViewedArrayBuffer]] internal slot. 1. Let _length_ be _typedArray_.[[ArrayLength]]. 1. Let _accessIndex_ be ? ToIndex(_requestIndex_). 1. Assert: _accessIndex_ ≥ 0. @@ -40956,15 +40774,13 @@

GetWaiterList ( _block_: a Shared Data Block, - _i_: a non-negative integer, + _i_: a non-negative integer that is evenly divisble by 4, )

- 1. Assert: _block_ is a Shared Data Block. 1. Assert: _i_ and _i_ + 3 are valid byte offsets within the memory of _block_. - 1. Assert: _i_ is divisible by 4. 1. Return the WaiterList that is referenced by the pair (_block_, _i_).
@@ -41136,7 +40952,7 @@

ByteListBitwiseOp ( - _op_: a sequence of Unicode code points, + _op_: `&`, `^`, or `|`, _xBytes_: a List of byte values, _yBytes_: a List of byte values, ) @@ -41146,7 +40962,6 @@

The operation atomically performs a bitwise operation on all byte values of the arguments and returns a List of byte values.
- 1. Assert: _op_ is `&`, `^`, or `|`. 1. Assert: _xBytes_ and _yBytes_ have the same number of elements. 1. Let _result_ be a new empty List. 1. Let _i_ be 0. @@ -42297,7 +42112,7 @@

The AsyncIterator Interface

*"next"* A function that returns a promise for an IteratorResult object. -

The returned promise, when fulfilled, must fulfill with an object which conforms to the IteratorResult interface. If a previous call to the `next` method of an AsyncIterator has returned a promise for an IteratorResult object whose *"done"* property is *true*, then all subsequent calls to the `next` method of that object should also return a promise for an IteratorResult object whose *"done"* property is *true*. However, this requirement is not enforced.

+

The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. If a previous call to the `next` method of an AsyncIterator has returned a promise for an IteratorResult object whose *"done"* property is *true*, then all subsequent calls to the `next` method of that object should also return a promise for an IteratorResult object whose *"done"* property is *true*. However, this requirement is not enforced.

Additionally, the IteratorResult object that serves as a fulfillment value should have a *"value"* property whose value is not a promise (or "thenable"). However, this requirement is also not enforced.

@@ -42320,7 +42135,7 @@

The AsyncIterator Interface

*"return"* A function that returns a promise for an IteratorResult object. -

The returned promise, when fulfilled, must fulfill with an object which conforms to the IteratorResult interface. Invoking this method notifies the AsyncIterator object that the caller does not intend to make any more `next` method calls to the AsyncIterator. The returned promise will fulfill with an IteratorResult object which will typically have a *"done"* property whose value is *true*, and a *"value"* property with the value passed as the argument of the `return` method. However, this requirement is not enforced.

+

The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. Invoking this method notifies the AsyncIterator object that the caller does not intend to make any more `next` method calls to the AsyncIterator. The returned promise will fulfill with an IteratorResult object which will typically have a *"done"* property whose value is *true*, and a *"value"* property with the value passed as the argument of the `return` method. However, this requirement is not enforced.

Additionally, the IteratorResult object that serves as a fulfillment value should have a *"value"* property whose value is not a promise (or "thenable"). If the argument value is used in the typical manner, then if it is a rejected promise, a promise rejected with the same reason should be returned; if it is a fulfilled promise, then its fulfillment value should be used as the *"value"* property of the returned promise's IteratorResult object fulfillment value. However, these requirements are also not enforced.

@@ -42329,7 +42144,7 @@

The AsyncIterator Interface

*"throw"* A function that returns a promise for an IteratorResult object. -

The returned promise, when fulfilled, must fulfill with an object which conforms to the IteratorResult interface. Invoking this method notifies the AsyncIterator object that the caller has detected an error condition. The argument may be used to identify the error condition and typically will be an exception object. A typical response is to return a rejected promise which rejects with the value passed as the argument.

+

The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. Invoking this method notifies the AsyncIterator object that the caller has detected an error condition. The argument may be used to identify the error condition and typically will be an exception object. A typical response is to return a rejected promise which rejects with the value passed as the argument.

If the returned promise is fulfilled, the IteratorResult fulfillment value will typically have a *"done"* property whose value is *true*. Additionally, it should have a *"value"* property whose value is not a promise (or "thenable"), but this requirement is not enforced.

@@ -42468,7 +42283,7 @@

The %AsyncFromSyncIteratorPrototype% Object

%AsyncFromSyncIteratorPrototype%.next ( [ _value_ ] )

1. Let _O_ be the *this* value. - 1. Assert: Type(_O_) is Object and _O_ has a [[SyncIteratorRecord]] internal slot. + 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _syncIteratorRecord_ be _O_.[[SyncIteratorRecord]]. 1. If _value_ is present, then @@ -42485,7 +42300,7 @@

%AsyncFromSyncIteratorPrototype%.return ( [ _value_ ] )

1. Let _O_ be the *this* value. - 1. Assert: Type(_O_) is Object and _O_ has a [[SyncIteratorRecord]] internal slot. + 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _syncIterator_ be _O_.[[SyncIteratorRecord]].[[Iterator]]. 1. Let _return_ be GetMethod(_syncIterator_, *"return"*). @@ -42512,7 +42327,7 @@

%AsyncFromSyncIteratorPrototype%.throw ( [ _value_ ] )

1. Let _O_ be the *this* value. - 1. Assert: Type(_O_) is Object and _O_ has a [[SyncIteratorRecord]] internal slot. + 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _syncIterator_ be _O_.[[SyncIteratorRecord]].[[Iterator]]. 1. Let _throw_ be GetMethod(_syncIterator_, *"throw"*). @@ -42957,7 +42772,7 @@

Promise Jobs

NewPromiseReactionJob ( - _reaction_: unknown, + _reaction_: a PromiseReaction Record, _argument_: unknown, )

@@ -42967,7 +42782,6 @@

1. Let _job_ be a new Job Abstract Closure with no parameters that captures _reaction_ and _argument_ and performs the following steps when called: - 1. Assert: _reaction_ is a PromiseReaction Record. 1. Let _promiseCapability_ be _reaction_.[[Capability]]. 1. Let _type_ be _reaction_.[[Type]]. 1. Let _handler_ be _reaction_.[[Handler]]. @@ -43094,13 +42908,12 @@

Promise.all ( _iterable_ )

GetPromiseResolve ( - _promiseConstructor_: unknown, + _promiseConstructor_: a constructor, )

- 1. Assert: IsConstructor(_promiseConstructor_) is *true*. 1. Let _promiseResolve_ be ? Get(_promiseConstructor_, *"resolve"*). 1. If IsCallable(_promiseResolve_) is *false*, throw a *TypeError* exception. 1. Return _promiseResolve_. @@ -43111,16 +42924,14 @@

PerformPromiseAll ( _iteratorRecord_: unknown, - _constructor_: unknown, + _constructor_: a constructor, _resultCapability_: a PromiseCapability Record, - _promiseResolve_: unknown, + _promiseResolve_: a function object, )

- 1. Assert: IsConstructor(_constructor_) is *true*. - 1. Assert: IsCallable(_promiseResolve_) is *true*. 1. Let _values_ be a new empty List. 1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }. 1. Let _index_ be 0. @@ -43201,16 +43012,14 @@

Promise.allSettled ( _iterable_ )

PerformPromiseAllSettled ( _iteratorRecord_: unknown, - _constructor_: unknown, + _constructor_: a constructor, _resultCapability_: a PromiseCapability Record, - _promiseResolve_: unknown, + _promiseResolve_: a function object, )

- 1. Assert: ! IsConstructor(_constructor_) is *true*. - 1. Assert: IsCallable(_promiseResolve_) is *true*. 1. Let _values_ be a new empty List. 1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }. 1. Let _index_ be 0. @@ -43330,16 +43139,14 @@

Promise.any ( _iterable_ )

PerformPromiseAny ( _iteratorRecord_: unknown, - _constructor_: unknown, + _constructor_: a constructor, _resultCapability_: a PromiseCapability Record, - _promiseResolve_: unknown, + _promiseResolve_: a function object, )

- 1. Assert: ! IsConstructor(_constructor_) is *true*. - 1. Assert: ! IsCallable(_promiseResolve_) is *true*. 1. Let _errors_ be a new empty List. 1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }. 1. Let _index_ be 0. @@ -43431,16 +43238,14 @@

Promise.race ( _iterable_ )

PerformPromiseRace ( _iteratorRecord_: unknown, - _constructor_: unknown, + _constructor_: a constructor, _resultCapability_: a PromiseCapability Record, - _promiseResolve_: unknown, + _promiseResolve_: a function object, )

- 1. Assert: IsConstructor(_constructor_) is *true*. - 1. Assert: IsCallable(_promiseResolve_) is *true*. 1. Repeat, 1. Let _next_ be IteratorStep(_iteratorRecord_). 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*. @@ -43495,7 +43300,6 @@

It returns a new promise resolved with _x_.
- 1. Assert: Type(_C_) is Object. 1. If IsPromise(_x_) is *true*, then 1. Let _xConstructor_ be ? Get(_x_, *"constructor"*). 1. If SameValue(_xConstructor_, _C_) is *true*, return _x_. @@ -44024,7 +43828,7 @@

Generator Abstract Operations

GeneratorStart ( _generator_: unknown, - _generatorBody_: a Parse Node or an Abstract Closure with no parameters, + _generatorBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters, )

@@ -44148,13 +43952,12 @@

GetGeneratorKind ( )

GeneratorYield ( - _iterNextObj_: unknown, + _iterNextObj_: an Object that conforms to the IteratorResult interface, )

- 1. Assert: _iterNextObj_ is an Object that implements the IteratorResult interface. 1. Let _genContext_ be the running execution context. 1. Assert: _genContext_ is the execution context of a generator. 1. Let _generator_ be the value of the Generator component of _genContext_. @@ -44375,14 +44178,13 @@

AsyncGeneratorRequest Records

AsyncGeneratorStart ( - _generator_: unknown, - _generatorBody_: a Parse Node or an Abstract Closure with no parameters, + _generator_: an AsyncGenerator, + _generatorBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters, )

- 1. Assert: _generator_ is an AsyncGenerator instance. 1. Assert: _generator_.[[AsyncGeneratorState]] is *undefined*. 1. Let _genContext_ be the running execution context. 1. Set the Generator component of _genContext_ to _generator_. @@ -45386,7 +45188,6 @@

- 1. Assert: _R_ is a ReadSharedMemory or ReadModifyWriteSharedMemory event. 1. Let _Ws_ be _execution_.[[ReadsBytesFrom]](_R_). 1. Assert: _Ws_ is a List of WriteSharedMemory or ReadModifyWriteSharedMemory events with length equal to _R_.[[ElementSize]]. 1. Return ComposeWriteEventBytes(_execution_, _R_.[[ByteIndex]], _Ws_).