These operations are not a part of the ECMAScript language; they are defined here solely to aid the specification of the semantics of the ECMAScript language. Other, more specialized abstract operations are defined throughout this specification.
7.1 Type ConversionThe ECMAScript language implicitly performs automatic type conversion as needed. To clarify the semantics of certain constructs it is useful to define a set of conversion abstract operations . The conversion abstract operations are polymorphic; they can accept a value of any ECMAScript language type . But no other specification types are used with these operations.
The BigInt type has no implicit conversions in the ECMAScript language; programmers must call BigInt explicitly to convert values from other types.
7.1.1 ToPrimitive ( input [ , preferredType ] )The abstract operation ToPrimitive takes argument input (an ECMAScript language value ) and optional argument preferredType ( string or number ) and returns either a normal completion containing an ECMAScript language value or a throw completion . 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. It performs the following steps when called:
When ToPrimitive is called without a hint, then it generally behaves as if the hint were number . However, objects may over-ride this behaviour by defining a %Symbol.toPrimitive% method. Of the objects defined in this specification only Dates (see 21.4.4.45 ) and Symbol objects (see 20.4.3.5 ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were string .
7.1.1.1 OrdinaryToPrimitive ( O, hint )The abstract operation OrdinaryToPrimitive takes arguments O (an Object) and hint ( string or number ) and returns either a normal completion containing an ECMAScript language value or a throw completion . It performs the following steps when called:
The abstract operation ToBoolean takes argument argument (an ECMAScript language value ) and returns a Boolean. It converts argument to a value of type Boolean. It performs the following steps when called:
The abstract operation ToNumeric takes argument value (an ECMAScript language value ) and returns either a normal completion containing either a Number or a BigInt, or a throw completion . It returns value converted to a Number or a BigInt. It performs the following steps when called:
The abstract operation ToNumber takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a Number or a throw completion . It converts argument to a value of type Number. It performs the following steps when called:
The abstract operation StringToNumber specifies how to convert a String value to a Number value, using the following grammar.
Syntax StringNumericLiteral ::: StrWhiteSpace opt StrWhiteSpace opt StrNumericLiteral StrWhiteSpace opt StrWhiteSpace ::: StrWhiteSpaceChar StrWhiteSpace opt StrWhiteSpaceChar ::: WhiteSpace LineTerminator StrNumericLiteral ::: StrDecimalLiteral NonDecimalIntegerLiteral [~Sep] StrDecimalLiteral ::: StrUnsignedDecimalLiteral + StrUnsignedDecimalLiteral - StrUnsignedDecimalLiteral StrUnsignedDecimalLiteral ::: Infinity DecimalDigits [~Sep] . DecimalDigits [~Sep] opt ExponentPart [~Sep] opt . DecimalDigits [~Sep] ExponentPart [~Sep] opt DecimalDigits [~Sep] ExponentPart [~Sep] optAll grammar symbols not explicitly defined above have the definitions used in the Lexical Grammar for numeric literals ( 12.9.3 )
NoteSome differences should be noted between the syntax of a StringNumericLiteral and a NumericLiteral :
0
digits.+
or -
to indicate its sign.Infinity
and -Infinity
are recognized as a StringNumericLiteral but not as a NumericLiteral .The abstract operation StringToNumber takes argument str (a String) and returns a Number. It performs the following steps when called:
The syntax-directed operation StringNumericValue takes no arguments and returns a Number.
NoteThe conversion of a StringNumericLiteral to a Number value is similar overall to the determination of the NumericValue of a NumericLiteral (see 12.9.3 ), but some of the details are different.
It is defined piecewise over the following productions:
StringNumericLiteral ::: StrWhiteSpace optThe abstract operation RoundMVResult takes argument n (a mathematical value ) and returns a Number. It converts n to a Number in an implementation-defined manner. For the purposes of this abstract operation, a digit is significant if it is not zero or there is a non-zero digit to its left and there is a non-zero digit to its right. For the purposes of this abstract operation, "the mathematical value denoted by" a representation of a mathematical value is the inverse of "the decimal representation of" a mathematical value . It performs the following steps when called:
The abstract operation ToIntegerOrInfinity takes argument argument (an ECMAScript language value ) and returns either a normal completion containing either an integer , +∞, or -∞, or a throw completion . It converts argument to an integer representing its Number value with fractional part truncated, or to +∞ or -∞ when that Number value is infinite. It performs the following steps when called:
(ToIntegerOrInfinity(
x)) never returns
-0 𝔽for any value of
x. The truncation of the fractional part is performed after converting
xto a
mathematical value.
7.1.6 ToInt32 ( argument )The abstract operation ToInt32 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It converts argument to one of 232 integral Number values in the inclusive interval from 𝔽 (-231) to 𝔽 (231 - 1). It performs the following steps when called:
Given the above definition of ToInt32:
The abstract operation ToUint32 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It converts argument to one of 232 integral Number values in the inclusive interval from +0 𝔽 to 𝔽 (232 - 1). It performs the following steps when called:
Given the above definition of ToUint32:
The abstract operation ToInt16 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It converts argument to one of 216 integral Number values in the inclusive interval from 𝔽 (-215) to 𝔽 (215 - 1). It performs the following steps when called:
The abstract operation ToUint16 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It converts argument to one of 216 integral Number values in the inclusive interval from +0 𝔽 to 𝔽 (216 - 1). It performs the following steps when called:
Given the above definition of ToUint16:
The abstract operation ToInt8 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It converts argument to one of 28 integral Number values in the inclusive interval from -128 𝔽 to 127 𝔽. It performs the following steps when called:
The abstract operation ToUint8 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It converts argument to one of 28 integral Number values in the inclusive interval from +0 𝔽 to 255 𝔽. It performs the following steps when called:
The abstract operation ToUint8Clamp takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an integral Number or a throw completion . It clamps and rounds argument to one of 28 integral Number values in the inclusive interval from +0 𝔽 to 255 𝔽. It performs the following steps when called:
Unlike most other ECMAScript integer conversion operations, ToUint8Clamp rounds rather than truncates non-integral values. It also uses “round half to even” tie-breaking, which differs from the “round half up” tie-breaking of Math.round
.
The abstract operation ToBigInt takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a BigInt or a throw completion . It converts argument to a BigInt value, or throws if an implicit conversion from Number would be required. It performs the following steps when called:
1n
if prim is true and 0n
if prim is false . BigInt Return prim. Number Throw a TypeError exception. String
The abstract operation StringToBigInt takes argument str (a String) and returns a BigInt or undefined . It performs the following steps when called:
StringToBigInt uses the following grammar.
Syntax StringIntegerLiteral ::: StrWhiteSpace opt StrWhiteSpace opt StrIntegerLiteral StrWhiteSpace opt StrIntegerLiteral ::: SignedInteger [~Sep] NonDecimalIntegerLiteral [~Sep] 7.1.14.2 Runtime Semantics: MVThe abstract operation ToBigInt64 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a BigInt or a throw completion . It converts argument to one of 264 BigInt values in the inclusive interval from ℤ (-263) to ℤ (263 - 1). It performs the following steps when called:
The abstract operation ToBigUint64 takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a BigInt or a throw completion . It converts argument to one of 264 BigInt values in the inclusive interval from 0 ℤ to ℤ (264 - 1). It performs the following steps when called:
7.1.17 ToString ( argument )The abstract operation ToString takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a String or a throw completion . It converts argument to a value of type String. It performs the following steps when called:
The abstract operation ToObject takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an Object or a throw completion . It converts argument to a value of type Object according to Table 13 :
Table 13: ToObject Conversions Argument Type Result Undefined Throw a TypeError exception. Null Throw a TypeError exception. Boolean Return a new Boolean object whose [[BooleanData]] internal slot is set to argument. See 20.3 for a description of Boolean objects. Number Return a new Number object whose [[NumberData]] internal slot is set to argument. See 21.1 for a description of Number objects. String Return a new String object whose [[StringData]] internal slot is set to argument. See 22.1 for a description of String objects. Symbol Return a new Symbol object whose [[SymbolData]] internal slot is set to argument. See 20.4 for a description of Symbol objects. BigInt Return a new BigInt object whose [[BigIntData]] internal slot is set to argument. See 21.2 for a description of BigInt objects. Object Return argument. 7.1.19 ToPropertyKey ( argument )The abstract operation ToPropertyKey takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a property key or a throw completion . It converts argument to a value that can be used as a property key . It performs the following steps when called:
The abstract operation ToLength takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a non-negative integral Number or a throw completion . It clamps and truncates argument to a non-negative integral Number suitable for use as the length of an array-like object . It performs the following steps when called:
The abstract operation CanonicalNumericIndexString takes argument argument (a String) and returns a Number or undefined . If argument is either "-0" or exactly matches ToString (n) for some Number value n, it returns the respective Number value. Otherwise, it returns undefined . It performs the following steps when called:
A canonical numeric string is any String for which the CanonicalNumericIndexString abstract operation does not return undefined .
7.1.22 ToIndex ( value )The abstract operation ToIndex takes argument value (an ECMAScript language value ) and returns either a normal completion containing a non-negative integer or a throw completion . It converts value to an integer and returns that integer if it is non-negative and corresponds with an integer index . Otherwise, it throws an exception. It performs the following steps when called:
The abstract operation RequireObjectCoercible takes argument argument (an ECMAScript language value ) and returns either a normal completion containing an ECMAScript language value or a throw completion . It throws an error if argument is a value that cannot be converted to an Object using ToObject . It is defined by Table 14 :
Table 14: RequireObjectCoercible Results Argument Type Result Undefined Throw a TypeError exception. Null Throw a TypeError exception. Boolean Return argument. Number Return argument. String Return argument. Symbol Return argument. BigInt Return argument. Object Return argument. 7.2.2 IsArray ( argument )The abstract operation IsArray takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a Boolean or a throw completion . It performs the following steps when called:
The abstract operation IsCallable takes argument argument (an ECMAScript language value ) and returns a Boolean. It determines if argument is a callable function with a [[Call]] internal method. It performs the following steps when called:
The abstract operation IsConstructor takes argument argument (an ECMAScript language value ) and returns a Boolean. It determines if argument is a function object with a [[Construct]] internal method. It performs the following steps when called:
The abstract operation IsExtensible takes argument O (an Object) and returns either a normal completion containing a Boolean or a throw completion . It is used to determine whether additional properties can be added to O. It performs the following steps when called:
The abstract operation IsRegExp takes argument argument (an ECMAScript language value ) and returns either a normal completion containing a Boolean or a throw completion . It performs the following steps when called:
The abstract operation IsStringWellFormedUnicode takes argument string (a String) and returns a Boolean. It interprets string as a sequence of UTF-16 encoded code points, as described in 6.1.4 , and determines whether it is a well formed UTF-16 sequence. It performs the following steps when called:
The abstract operation SameType takes arguments x (an ECMAScript language value ) and y (an ECMAScript language value ) and returns a Boolean. It determines whether or not the two arguments are the same type. It performs the following steps when called:
The abstract operation SameValue takes arguments x (an ECMAScript language value ) and y (an ECMAScript language value ) and returns a Boolean. It determines whether or not the two arguments are the same value. It performs the following steps when called:
This algorithm differs from the IsStrictlyEqual Algorithm by treating all NaN values as equivalent and by differentiating +0 𝔽 from -0 𝔽.
7.2.10 SameValueZero ( x, y )The abstract operation SameValueZero takes arguments x (an ECMAScript language value ) and y (an ECMAScript language value ) and returns a Boolean. It determines whether or not the two arguments are the same value (ignoring the difference between +0 𝔽 and -0 𝔽). It performs the following steps when called:
SameValueZero differs from SameValue only in that it treats +0 𝔽 and -0 𝔽 as equivalent.
7.2.11 SameValueNonNumber ( x, y )The abstract operation SameValueNonNumber takes arguments x (an ECMAScript language value , but not a Number) and y (an ECMAScript language value , but not a Number) and returns a Boolean. It performs the following steps when called:
For expository purposes, some cases are handled separately within this algorithm even if it is unnecessary to do so.
Note 2The specifics of what "
xis
y" means are detailed in
5.2.7.
7.2.12 IsLessThan ( x, y, LeftFirst )The abstract operation IsLessThan takes arguments x (an ECMAScript language value ), y (an ECMAScript language value ), and LeftFirst (a Boolean) and returns either a normal completion containing either a Boolean or undefined , or a throw completion . It provides the semantics for the comparison x < y, returning true , false , or undefined (which indicates that at least one operand is NaN ). The LeftFirst flag is used to control the order in which operations with potentially visible side-effects are performed upon x and y. It is necessary because ECMAScript specifies left to right evaluation of expressions. If LeftFirst is true , the x parameter corresponds to an expression that occurs to the left of the y parameter's corresponding expression. If LeftFirst is false , the reverse is the case and operations must be performed upon y before x. It performs the following steps when called:
Step 3 differs from step 1.c in the algorithm that handles the addition operator +
( 13.15.3 ) by using the logical-and operation instead of the logical-or operation.
The comparison of Strings uses a simple lexicographic ordering on sequences of UTF-16 code unit values. There is no attempt to use the more complex, semantically oriented definitions of character or string equality and collating order defined in the Unicode specification. Therefore String values that are canonically equal according to the Unicode Standard but not in the same normalization form could test as unequal. Also note that lexicographic ordering by code unit differs from ordering by code point for Strings containing surrogate pairs .
7.2.13 IsLooselyEqual ( x, y )The abstract operation IsLooselyEqual takes arguments x (an ECMAScript language value ) and y (an ECMAScript language value ) and returns either a normal completion containing a Boolean or a throw completion . It provides the semantics for the ==
operator. It performs the following steps when called:
The abstract operation IsStrictlyEqual takes arguments x (an ECMAScript language value ) and y (an ECMAScript language value ) and returns a Boolean. It provides the semantics for the ===
operator. It performs the following steps when called:
This algorithm differs from the SameValue Algorithm in its treatment of signed zeroes and NaNs.
7.3 Operations on Objects 7.3.1 MakeBasicObject ( internalSlotsList )The abstract operation MakeBasicObject takes argument internalSlotsList (a List of internal slot names) and returns an Object. It is the source of all ECMAScript objects that are created algorithmically, including both ordinary objects and exotic objects . It factors out common steps used in creating all objects, and centralizes object creation. It performs the following steps when called:
Within this specification, exotic objects are created in abstract operations such as ArrayCreate and BoundFunctionCreate by first calling MakeBasicObject to obtain a basic, foundational object, and then overriding some or all of that object's internal methods. In order to encapsulate exotic object creation, the object's essential internal methods are never modified outside those operations.
7.3.2 Get ( O, P )The abstract operation Get takes arguments O (an Object) and P (a property key ) and returns either a normal completion containing an ECMAScript language value or a throw completion . It is used to retrieve the value of a specific property of an object. It performs the following steps when called:
The abstract operation GetV takes arguments V (an ECMAScript language value ) and P (a property key ) and returns either a normal completion containing an ECMAScript language value or a throw completion . 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. It performs the following steps when called:
The abstract operation Set takes arguments O (an Object), P (a property key ), V (an ECMAScript language value ), and Throw (a Boolean) and returns either a normal completion containing unused or a throw completion . It is used to set the value of a specific property of an object. V is the new value for the property. It performs the following steps when called:
The abstract operation CreateDataProperty takes arguments O (an Object), P (a property key ), and V (an ECMAScript language value ) and returns either a normal completion containing a Boolean or a throw completion . It is used to create a new own property of an object. It performs the following steps when called:
This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return false .
7.3.6 CreateDataPropertyOrThrow ( O, P, V )The abstract operation CreateDataPropertyOrThrow takes arguments O (an Object), P (a property key ), and V (an ECMAScript language value ) and returns either a normal completion containing unused or a throw completion . 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. It performs the following steps when called:
This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return false causing this operation to throw a TypeError exception.
7.3.7 CreateNonEnumerableDataPropertyOrThrow ( O, P, V )The abstract operation CreateNonEnumerableDataPropertyOrThrow takes arguments O (an Object), P (a property key ), and V (an ECMAScript language value ) and returns unused . It is used to create a new non-enumerable own property of an ordinary object . It performs the following steps when called:
This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator except it is not enumerable. Normally, the property will not already exist. If it does exist, DefinePropertyOrThrow is guaranteed to complete normally.
7.3.8 DefinePropertyOrThrow ( O, P, desc )The abstract operation DefinePropertyOrThrow takes arguments O (an Object), P (a property key ), and desc (a Property Descriptor ) and returns either a normal completion containing unused or a throw completion . 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. It performs the following steps when called:
The abstract operation DeletePropertyOrThrow takes arguments O (an Object) and P (a property key ) and returns either a normal completion containing unused or a throw completion . It is used to remove a specific own property of an object. It throws an exception if the property is not configurable. It performs the following steps when called:
The abstract operation GetMethod takes arguments V (an ECMAScript language value ) and P (a property key ) and returns either a normal completion containing either a function object or undefined , or a throw completion . 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. It performs the following steps when called:
The abstract operation HasProperty takes arguments O (an Object) and P (a property key ) and returns either a normal completion containing a Boolean or a throw completion . It is used to determine whether an object has a property with the specified property key . The property may be either own or inherited. It performs the following steps when called:
The abstract operation HasOwnProperty takes arguments O (an Object) and P (a property key ) and returns either a normal completion containing a Boolean or a throw completion . It is used to determine whether an object has an own property with the specified property key . It performs the following steps when called:
The abstract operation Call takes arguments F (an ECMAScript language value ) and V (an ECMAScript language value ) and optional argument argumentsList (a List of ECMAScript language values ) and returns either a normal completion containing an ECMAScript language value or a throw completion . It is used to call the [[Call]] internal method of a function object . F is the function object , V is an ECMAScript language value that is the this value of the [[Call]], and argumentsList is the value passed to the corresponding argument of the internal method. If argumentsList is not present, a new empty List is used as its value. It performs the following steps when called:
The abstract operation Construct takes argument F (a constructor ) and optional arguments argumentsList (a List of ECMAScript language values ) and newTarget (a constructor ) and returns either a normal completion containing an Object or a throw completion . It is used to call the [[Construct]] internal method of a function object . argumentsList and newTarget are the values to be passed as the corresponding arguments of the internal method. If argumentsList is not present, a new empty List is used as its value. If newTarget is not present, F is used as its value. It performs the following steps when called:
If newTarget is not present, this operation is equivalent to: new F(...argumentsList)
The abstract operation SetIntegrityLevel takes arguments O (an Object) and level ( sealed or frozen ) and returns either a normal completion containing a Boolean or a throw completion . It is used to fix the set of own properties of an object. It performs the following steps when called:
The abstract operation TestIntegrityLevel takes arguments O (an Object) and level ( sealed or frozen ) and returns either a normal completion containing a Boolean or a throw completion . It is used to determine if the set of own properties of an object are fixed. It performs the following steps when called:
The abstract operation CreateArrayFromList takes argument elements (a List of ECMAScript language values ) and returns an Array. It is used to create an Array whose elements are provided by elements. It performs the following steps when called:
The abstract operation LengthOfArrayLike takes argument obj (an Object) and returns either a normal completion containing a non-negative integer or a throw completion . It returns the value of the "length" property of an array-like object. It performs the following steps when called:
An array-like object is any object for which this operation returns a normal completion .
Note 1Typically, an array-like object would also have some properties with
integer indexnames. However, that is not a requirement of this definition.
Note 2Arrays and String objects are examples of array-like objects.
7.3.19 CreateListFromArrayLike ( obj [ , validElementTypes ] )The abstract operation CreateListFromArrayLike takes argument obj (an ECMAScript language value ) and optional argument validElementTypes ( all or property-key ) and returns either a normal completion containing a List of ECMAScript language values or a throw completion . It is used to create a List value whose elements are provided by the indexed properties of obj. validElementTypes indicates the types of values that are allowed as elements. It performs the following steps when called:
The abstract operation Invoke takes arguments V (an ECMAScript language value ) and P (a property key ) and optional argument argumentsList (a List of ECMAScript language values ) and returns either a normal completion containing an ECMAScript language value or a throw completion . It is used to call a method property of an ECMAScript language value . V serves as both the lookup point for the property and the this value of the call. argumentsList is the list of arguments values passed to the method. If argumentsList is not present, a new empty List is used as its value. It performs the following steps when called:
The abstract operation OrdinaryHasInstance takes arguments C (an ECMAScript language value ) and O (an ECMAScript language value ) and returns either a normal completion containing a Boolean or a throw completion . It implements the default algorithm for determining if O inherits from the instance object inheritance path provided by C. It performs the following steps when called:
The abstract operation SpeciesConstructor takes arguments O (an Object) and defaultConstructor (a constructor ) and returns either a normal completion containing a constructor or a throw completion . 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 %Symbol.species% property cannot be found starting from O. It performs the following steps when called:
The abstract operation EnumerableOwnProperties takes arguments O (an Object) and kind ( key , value , or key+value ) and returns either a normal completion containing a List of ECMAScript language values or a throw completion . It performs the following steps when called:
The abstract operation GetFunctionRealm takes argument obj (a function object ) and returns either a normal completion containing a Realm Record or a throw completion . It performs the following steps when called:
Step 4 will only be reached if obj is a non-standard function exotic object that does not have a [[Realm]] internal slot.
7.3.25 CopyDataProperties ( target, source, excludedItems )The abstract operation CopyDataProperties takes arguments target (an Object), source (an ECMAScript language value ), and excludedItems (a List of property keys ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
The target passed in here is always a newly created object which is not directly accessible in case of an error being thrown.
7.3.26 PrivateElementFind ( O, P )The abstract operation PrivateElementFind takes arguments O (an Object) and P (a Private Name ) and returns a PrivateElement or empty . It performs the following steps when called:
The abstract operation PrivateFieldAdd takes arguments O (an Object), P (a Private Name ), and value (an ECMAScript language value ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
The abstract operation PrivateMethodOrAccessorAdd takes arguments O (an Object) and method (a PrivateElement ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
The values for private methods and accessors are shared across instances. This operation does not create a new copy of the method or accessor.
7.3.29 HostEnsureCanAddPrivateElement ( O )The host-defined abstract operation HostEnsureCanAddPrivateElement takes argument O (an Object) and returns either a normal completion containing unused or a throw completion . It allows host environments to prevent the addition of private elements to particular host-defined exotic objects .
An implementation of HostEnsureCanAddPrivateElement must conform to the following requirements:
The default implementation of HostEnsureCanAddPrivateElement is to return NormalCompletion ( unused ).
This abstract operation is only invoked by ECMAScript hosts that are web browsers.
7.3.30 PrivateGet ( O, P )The abstract operation PrivateGet takes arguments O (an Object) and P (a Private Name ) and returns either a normal completion containing an ECMAScript language value or a throw completion . It performs the following steps when called:
The abstract operation PrivateSet takes arguments O (an Object), P (a Private Name ), and value (an ECMAScript language value ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
The abstract operation DefineField takes arguments receiver (an Object) and fieldRecord (a ClassFieldDefinition Record ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
The abstract operation InitializeInstanceElements takes arguments O (an Object) and constructor (an ECMAScript function object ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
The abstract operation AddValueToKeyedGroup takes arguments groups (a List of Records with fields [[Key]] (an ECMAScript language value ) and [[Elements]] (a List of ECMAScript language values )), key (an ECMAScript language value ), and value (an ECMAScript language value ) and returns unused . It performs the following steps when called:
The abstract operation GroupBy takes arguments items (an ECMAScript language value ), callback (an ECMAScript language value ), and keyCoercion ( property or collection ) and returns either a normal completion containing a List of Records with fields [[Key]] (an ECMAScript language value ) and [[Elements]] (a List of ECMAScript language values ), or a throw completion . It performs the following steps when called:
The abstract operation SetterThatIgnoresPrototypeProperties takes arguments thisValue (an ECMAScript language value ), home (an Object), p (a property key ), and v (an ECMAScript language value ) and returns either a normal completion containing unused or a throw completion . It performs the following steps when called:
See Common Iteration Interfaces ( 27.1 ).
7.4.1 Iterator RecordsAn Iterator Record is a Record value used to encapsulate an iterator or async iterator along with the next
method.
Iterator Records have the fields listed in Table 15 .
Table 15: Iterator Record Fields 7.4.2 GetIteratorDirect ( obj )The abstract operation GetIteratorDirect takes argument obj (an Object) and returns either a normal completion containing an Iterator Record or a throw completion . It performs the following steps when called:
The abstract operation GetIteratorFromMethod takes arguments obj (an ECMAScript language value ) and method (a function object ) and returns either a normal completion containing an Iterator Record or a throw completion . It performs the following steps when called:
The abstract operation GetIterator takes arguments obj (an ECMAScript language value ) and kind ( sync or async ) and returns either a normal completion containing an Iterator Record or a throw completion . It performs the following steps when called:
The abstract operation GetIteratorFlattenable takes arguments obj (an ECMAScript language value ) and primitiveHandling ( iterate-string-primitives or reject-primitives ) and returns either a normal completion containing an Iterator Record or a throw completion . It performs the following steps when called:
The abstract operation IteratorNext takes argument iteratorRecord (an Iterator Record ) and optional argument value (an ECMAScript language value ) and returns either a normal completion containing an Object or a throw completion . It performs the following steps when called:
The abstract operation IteratorComplete takes argument iteratorResult (an Object) and returns either a normal completion containing a Boolean or a throw completion . It performs the following steps when called:
7.4.8 IteratorValue ( iteratorResult )The abstract operation IteratorValue takes argument iteratorResult (an Object) and returns either a normal completion containing an ECMAScript language value or a throw completion . It performs the following steps when called:
The abstract operation IteratorStep takes argument iteratorRecord (an Iterator Record ) and returns either a normal completion containing either an Object or done , or a throw completion . It requests the next value from iteratorRecord.[[Iterator]] by calling iteratorRecord.[[NextMethod]] and returns either done indicating that the iterator has reached its end or the IteratorResult object if a next value is available. It performs the following steps when called:
The abstract operation IteratorStepValue takes argument iteratorRecord (an Iterator Record ) and returns either a normal completion containing either an ECMAScript language value or done , or a throw completion . It requests the next value from iteratorRecord.[[Iterator]] by calling iteratorRecord.[[NextMethod]] and returns either done indicating that the iterator has reached its end or the value from the IteratorResult object if a next value is available. It performs the following steps when called:
The abstract operation IteratorClose takes arguments iteratorRecord (an Iterator Record ) and completion (a Completion Record ) and returns a Completion Record . It is used to notify an iterator that it should perform any actions it would normally perform when it has reached its completed state. It performs the following steps when called:
IfAbruptCloseIterator is a shorthand for a sequence of algorithm steps that use an Iterator Record . An algorithm step of the form:
means the same thing as:
The abstract operation AsyncIteratorClose takes arguments iteratorRecord (an Iterator Record ) and completion (a Completion Record ) and returns a Completion Record . It is used to notify an async iterator that it should perform any actions it would normally perform when it has reached its completed state. It performs the following steps when called:
The abstract operation CreateIteratorResultObject takes arguments value (an ECMAScript language value ) and done (a Boolean) and returns an Object that conforms to the IteratorResult interface . It creates an object that conforms to the IteratorResult interface . It performs the following steps when called:
The abstract operation CreateListIteratorRecord takes argument list (a List of ECMAScript language values ) and returns an Iterator Record . It creates an Iterator Record whose [[NextMethod]] returns the successive elements of list. It performs the following steps when called:
The list iterator object is never directly accessible to ECMAScript code.
7.4.16 IteratorToList ( iteratorRecord )The abstract operation IteratorToList takes argument iteratorRecord (an Iterator Record ) and returns either a normal completion containing a List of ECMAScript language values or a throw completion . It performs the following steps when called:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3