CARVIEW |
- Introduction
- 1 Scope
- +2 Conformance
- 3 Normative References
- +4 Overview
- 4.1 Web Scripting
- 4.2 Hosts and Implementations
- +4.3 ECMAScript Overview
- +4.4 Terms and Definitions
- 4.4.1 implementation-approximated
- 4.4.2 implementation-defined
- 4.4.3 host-defined
- 4.4.4 type
- 4.4.5 primitive value
- 4.4.6 object
- 4.4.7 constructor
- 4.4.8 prototype
- 4.4.9 ordinary object
- 4.4.10 exotic object
- 4.4.11 standard object
- 4.4.12 built-in object
- 4.4.13 undefined value
- 4.4.14 Undefined type
- 4.4.15 null value
- 4.4.16 Null type
- 4.4.17 Boolean value
- 4.4.18 Boolean type
- 4.4.19 Boolean object
- 4.4.20 String value
- 4.4.21 String type
- 4.4.22 String object
- 4.4.23 Number value
- 4.4.24 Number type
- 4.4.25 Number object
- 4.4.26 Infinity
- 4.4.27 NaN
- 4.4.28 BigInt value
- 4.4.29 BigInt type
- 4.4.30 BigInt object
- 4.4.31 Symbol value
- 4.4.32 Symbol type
- 4.4.33 Symbol object
- 4.4.34 function
- 4.4.35 built-in function
- 4.4.36 built-in constructor
- 4.4.37 property
- 4.4.38 method
- 4.4.39 built-in method
- 4.4.40 attribute
- 4.4.41 own property
- 4.4.42 inherited property
- 4.5 Organization of This Specification
- +5 Notational Conventions
- +5.1 Syntactic and Lexical Grammars
- +5.2 Algorithm Conventions
- +6 ECMAScript Data Types and Values
- +6.1 ECMAScript Language Types
- 6.1.1 The Undefined Type
- 6.1.2 The Null Type
- 6.1.3 The Boolean Type
- +6.1.4 The String Type
- +6.1.5 The Symbol Type
- +6.1.6 Numeric Types
- +6.1.6.1 The Number Type
- 6.1.6.1.1 Number::unaryMinus ( x )
- 6.1.6.1.2 Number::bitwiseNOT ( x )
- 6.1.6.1.3 Number::exponentiate ( base, exponent )
- 6.1.6.1.4 Number::multiply ( x, y )
- 6.1.6.1.5 Number::divide ( x, y )
- 6.1.6.1.6 Number::remainder ( n, d )
- 6.1.6.1.7 Number::add ( x, y )
- 6.1.6.1.8 Number::subtract ( x, y )
- 6.1.6.1.9 Number::leftShift ( x, y )
- 6.1.6.1.10 Number::signedRightShift ( x, y )
- 6.1.6.1.11 Number::unsignedRightShift ( x, y )
- 6.1.6.1.12 Number::lessThan ( x, y )
- 6.1.6.1.13 Number::equal ( x, y )
- 6.1.6.1.14 Number::sameValue ( x, y )
- 6.1.6.1.15 Number::sameValueZero ( x, y )
- 6.1.6.1.16 NumberBitwiseOp ( op, x, y )
- 6.1.6.1.17 Number::bitwiseAND ( x, y )
- 6.1.6.1.18 Number::bitwiseXOR ( x, y )
- 6.1.6.1.19 Number::bitwiseOR ( x, y )
- 6.1.6.1.20 Number::toString ( x, radix )
- +6.1.6.2 The BigInt Type
- 6.1.6.2.1 BigInt::unaryMinus ( x )
- 6.1.6.2.2 BigInt::bitwiseNOT ( x )
- 6.1.6.2.3 BigInt::exponentiate ( base, exponent )
- 6.1.6.2.4 BigInt::multiply ( x, y )
- 6.1.6.2.5 BigInt::divide ( x, y )
- 6.1.6.2.6 BigInt::remainder ( n, d )
- 6.1.6.2.7 BigInt::add ( x, y )
- 6.1.6.2.8 BigInt::subtract ( x, y )
- 6.1.6.2.9 BigInt::leftShift ( x, y )
- 6.1.6.2.10 BigInt::signedRightShift ( x, y )
- 6.1.6.2.11 BigInt::unsignedRightShift ( x, y )
- 6.1.6.2.12 BigInt::lessThan ( x, y )
- 6.1.6.2.13 BigInt::equal ( x, y )
- 6.1.6.2.14 BinaryAnd ( x, y )
- 6.1.6.2.15 BinaryOr ( x, y )
- 6.1.6.2.16 BinaryXor ( x, y )
- 6.1.6.2.17 BigIntBitwiseOp ( op, x, y )
- 6.1.6.2.18 BigInt::bitwiseAND ( x, y )
- 6.1.6.2.19 BigInt::bitwiseXOR ( x, y )
- 6.1.6.2.20 BigInt::bitwiseOR ( x, y )
- 6.1.6.2.21 BigInt::toString ( x, radix )
- +6.1.6.1 The Number Type
- +6.1.7 The Object Type
- +6.2 ECMAScript Specification Types
- 6.2.1 The Enum Specification Type
- 6.2.2 The List and Record Specification Types
- 6.2.3 The Set and Relation Specification Types
- +6.2.4 The Completion Record Specification Type
- +6.2.5 The Reference Record Specification Type
- 6.2.5.1 IsPropertyReference ( V )
- 6.2.5.2 IsUnresolvableReference ( V )
- 6.2.5.3 IsSuperReference ( V )
- 6.2.5.4 IsPrivateReference ( V )
- 6.2.5.5 GetValue ( V )
- 6.2.5.6 PutValue ( V, W )
- 6.2.5.7 GetThisValue ( V )
- 6.2.5.8 InitializeReferencedBinding ( V, W )
- 6.2.5.9 MakePrivateReference ( baseValue, privateIdentifier )
- +6.2.6 The Property Descriptor Specification Type
- 6.2.7 The Environment Record Specification Type
- 6.2.8 The Abstract Closure Specification Type
- +6.2.9 Data Blocks
- 6.2.10 The PrivateElement Specification Type
- 6.2.11 The ClassFieldDefinition Record Specification Type
- 6.2.12 Private Names
- 6.2.13 The ClassStaticBlockDefinition Record Specification Type
- +6.1 ECMAScript Language Types
- +7 Abstract Operations
- +7.1 Type Conversion
- +7.1.1 ToPrimitive ( input [ , preferredType ] )
- 7.1.2 ToBoolean ( argument )
- 7.1.3 ToNumeric ( value )
- +7.1.4 ToNumber ( argument )
- 7.1.5 ToIntegerOrInfinity ( argument )
- 7.1.6 ToInt32 ( argument )
- 7.1.7 ToUint32 ( argument )
- 7.1.8 ToInt16 ( argument )
- 7.1.9 ToUint16 ( argument )
- 7.1.10 ToInt8 ( argument )
- 7.1.11 ToUint8 ( argument )
- 7.1.12 ToUint8Clamp ( argument )
- 7.1.13 ToBigInt ( argument )
- +7.1.14 StringToBigInt ( str )
- 7.1.15 ToBigInt64 ( argument )
- 7.1.16 ToBigUint64 ( argument )
- 7.1.17 ToString ( argument )
- 7.1.18 ToObject ( argument )
- 7.1.19 ToPropertyKey ( argument )
- 7.1.20 ToLength ( argument )
- 7.1.21 CanonicalNumericIndexString ( argument )
- 7.1.22 ToIndex ( value )
- +7.2 Testing and Comparison Operations
- 7.2.1 RequireObjectCoercible ( argument )
- 7.2.2 IsArray ( argument )
- 7.2.3 IsCallable ( argument )
- 7.2.4 IsConstructor ( argument )
- 7.2.5 IsExtensible ( O )
- 7.2.6 IsRegExp ( argument )
- 7.2.7 SS: IsStringWellFormedUnicode ( string )
- 7.2.8 SameType ( x, y )
- 7.2.9 SameValue ( x, y )
- 7.2.10 SameValueZero ( x, y )
- 7.2.11 SameValueNonNumber ( x, y )
- 7.2.12 IsLessThan ( x, y, LeftFirst )
- 7.2.13 IsLooselyEqual ( x, y )
- 7.2.14 IsStrictlyEqual ( x, y )
- +7.3 Operations on Objects
- 7.3.1 MakeBasicObject ( internalSlotsList )
- 7.3.2 Get ( O, P )
- 7.3.3 GetV ( V, P )
- 7.3.4 Set ( O, P, V, Throw )
- 7.3.5 CreateDataProperty ( O, P, V )
- 7.3.6 CreateDataPropertyOrThrow ( O, P, V )
- 7.3.7 CreateNonEnumerableDataPropertyOrThrow ( O, P, V )
- 7.3.8 DefinePropertyOrThrow ( O, P, desc )
- 7.3.9 DeletePropertyOrThrow ( O, P )
- 7.3.10 GetMethod ( V, P )
- 7.3.11 HasProperty ( O, P )
- 7.3.12 HasOwnProperty ( O, P )
- 7.3.13 Call ( F, V [ , argumentsList ] )
- 7.3.14 Construct ( F [ , argumentsList [ , newTarget ] ] )
- 7.3.15 SetIntegrityLevel ( O, level )
- 7.3.16 TestIntegrityLevel ( O, level )
- 7.3.17 CreateArrayFromList ( elements )
- 7.3.18 LengthOfArrayLike ( obj )
- 7.3.19 CreateListFromArrayLike ( obj [ , validElementTypes ] )
- 7.3.20 Invoke ( V, P [ , argumentsList ] )
- 7.3.21 OrdinaryHasInstance ( C, O )
- 7.3.22 SpeciesConstructor ( O, defaultConstructor )
- 7.3.23 EnumerableOwnProperties ( O, kind )
- 7.3.24 GetFunctionRealm ( obj )
- 7.3.25 CopyDataProperties ( target, source, excludedItems )
- 7.3.26 PrivateElementFind ( O, P )
- 7.3.27 PrivateFieldAdd ( O, P, value )
- 7.3.28 PrivateMethodOrAccessorAdd ( O, method )
- 7.3.29 HostEnsureCanAddPrivateElement ( O )
- 7.3.30 PrivateGet ( O, P )
- 7.3.31 PrivateSet ( O, P, value )
- 7.3.32 DefineField ( receiver, fieldRecord )
- 7.3.33 InitializeInstanceElements ( O, constructor )
- 7.3.34 AddValueToKeyedGroup ( groups, key, value )
- 7.3.35 GroupBy ( items, callback, keyCoercion )
- 7.3.36 SetterThatIgnoresPrototypeProperties ( thisValue, home, p, v )
- +7.4 Operations on Iterator Objects
- 7.4.1 Iterator Records
- 7.4.2 GetIteratorDirect ( obj )
- 7.4.3 GetIteratorFromMethod ( obj, method )
- 7.4.4 GetIterator ( obj, kind )
- 7.4.5 GetIteratorFlattenable ( obj, primitiveHandling )
- 7.4.6 IteratorNext ( iteratorRecord [ , value ] )
- 7.4.7 IteratorComplete ( iteratorResult )
- 7.4.8 IteratorValue ( iteratorResult )
- 7.4.9 IteratorStep ( iteratorRecord )
- 7.4.10 IteratorStepValue ( iteratorRecord )
- 7.4.11 IteratorClose ( iteratorRecord, completion )
- 7.4.12 IfAbruptCloseIterator ( value, iteratorRecord )
- 7.4.13 AsyncIteratorClose ( iteratorRecord, completion )
- 7.4.14 CreateIteratorResultObject ( value, done )
- 7.4.15 CreateListIteratorRecord ( list )
- 7.4.16 IteratorToList ( iteratorRecord )
- +7.1 Type Conversion
- +8 Syntax-Directed Operations
- 8.1 RS: Evaluation
- +8.2 Scope Analysis
- 8.2.1 SS: BoundNames
- 8.2.2 SS: DeclarationPart
- 8.2.3 SS: IsConstantDeclaration
- 8.2.4 SS: LexicallyDeclaredNames
- 8.2.5 SS: LexicallyScopedDeclarations
- 8.2.6 SS: VarDeclaredNames
- 8.2.7 SS: VarScopedDeclarations
- 8.2.8 SS: TopLevelLexicallyDeclaredNames
- 8.2.9 SS: TopLevelLexicallyScopedDeclarations
- 8.2.10 SS: TopLevelVarDeclaredNames
- 8.2.11 SS: TopLevelVarScopedDeclarations
- +8.3 Labels
- +8.4 Function Name Inference
- +8.5 Contains
- +8.6 Miscellaneous
- +9 Executable Code and Execution Contexts
- +9.1 Environment Records
- +9.1.1 The Environment Record Type Hierarchy
- +9.1.1.1 Declarative Environment Records
- 9.1.1.1.1 HasBinding ( N )
- 9.1.1.1.2 CreateMutableBinding ( N, D )
- 9.1.1.1.3 CreateImmutableBinding ( N, S )
- 9.1.1.1.4 InitializeBinding ( N, V )
- 9.1.1.1.5 SetMutableBinding ( N, V, S )
- 9.1.1.1.6 GetBindingValue ( N, S )
- 9.1.1.1.7 DeleteBinding ( N )
- 9.1.1.1.8 HasThisBinding ( )
- 9.1.1.1.9 HasSuperBinding ( )
- 9.1.1.1.10 WithBaseObject ( )
- +9.1.1.2 Object Environment Records
- 9.1.1.2.1 HasBinding ( N )
- 9.1.1.2.2 CreateMutableBinding ( N, D )
- 9.1.1.2.3 CreateImmutableBinding ( N, S )
- 9.1.1.2.4 InitializeBinding ( N, V )
- 9.1.1.2.5 SetMutableBinding ( N, V, S )
- 9.1.1.2.6 GetBindingValue ( N, S )
- 9.1.1.2.7 DeleteBinding ( N )
- 9.1.1.2.8 HasThisBinding ( )
- 9.1.1.2.9 HasSuperBinding ( )
- 9.1.1.2.10 WithBaseObject ( )
- +9.1.1.3 Function Environment Records
- +9.1.1.4 Global Environment Records
- 9.1.1.4.1 HasBinding ( N )
- 9.1.1.4.2 CreateMutableBinding ( N, D )
- 9.1.1.4.3 CreateImmutableBinding ( N, S )
- 9.1.1.4.4 InitializeBinding ( N, V )
- 9.1.1.4.5 SetMutableBinding ( N, V, S )
- 9.1.1.4.6 GetBindingValue ( N, S )
- 9.1.1.4.7 DeleteBinding ( N )
- 9.1.1.4.8 HasThisBinding ( )
- 9.1.1.4.9 HasSuperBinding ( )
- 9.1.1.4.10 WithBaseObject ( )
- 9.1.1.4.11 GetThisBinding ( )
- 9.1.1.4.12 HasLexicalDeclaration ( envRec, N )
- 9.1.1.4.13 HasRestrictedGlobalProperty ( envRec, N )
- 9.1.1.4.14 CanDeclareGlobalVar ( envRec, N )
- 9.1.1.4.15 CanDeclareGlobalFunction ( envRec, N )
- 9.1.1.4.16 CreateGlobalVarBinding ( envRec, N, D )
- 9.1.1.4.17 CreateGlobalFunctionBinding ( envRec, N, V, D )
- +9.1.1.5 Module Environment Records
- +9.1.1.1 Declarative Environment Records
- +9.1.2 Environment Record Operations
- +9.1.1 The Environment Record Type Hierarchy
- +9.2 PrivateEnvironment Records
- +9.3 Realms
- +9.4 Execution Contexts
- +9.5 Jobs and Host Operations to Enqueue Jobs
- +9.6 Agents
- 9.7 Agent Clusters
- 9.8 Forward Progress
- +9.9 Processing Model of WeakRef and FinalizationRegistry Targets
- 9.10 ClearKeptObjects ( )
- 9.11 AddToKeptObjects ( value )
- 9.12 CleanupFinalizationRegistry ( finalizationRegistry )
- 9.13 CanBeHeldWeakly ( v )
- +9.1 Environment Records
- +10 Ordinary and Exotic Objects Behaviours
- +10.1 Ordinary Object Internal Methods and Internal Slots
- +10.1.1 [[GetPrototypeOf]] ( )
- +10.1.2 [[SetPrototypeOf]] ( V )
- +10.1.3 [[IsExtensible]] ( )
- +10.1.4 [[PreventExtensions]] ( )
- +10.1.5 [[GetOwnProperty]] ( P )
- +10.1.6 [[DefineOwnProperty]] ( P, Desc )
- +10.1.7 [[HasProperty]] ( P )
- +10.1.8 [[Get]] ( P, Receiver )
- +10.1.9 [[Set]] ( P, V, Receiver )
- +10.1.10 [[Delete]] ( P )
- +10.1.11 [[OwnPropertyKeys]] ( )
- 10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] )
- 10.1.13 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] )
- 10.1.14 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
- 10.1.15 RequireInternalSlot ( O, internalSlot )
- +10.2 ECMAScript Function Objects
- +10.2.1 [[Call]] ( thisArgument, argumentsList )
- 10.2.2 [[Construct]] ( argumentsList, newTarget )
- 10.2.3 OrdinaryFunctionCreate ( functionPrototype, sourceText, ParameterList, Body, thisMode, env, privateEnv )
- +10.2.4 AddRestrictedFunctionProperties ( F, realm )
- 10.2.5 MakeConstructor ( F [ , writablePrototype [ , prototype ] ] )
- 10.2.6 MakeClassConstructor ( F )
- 10.2.7 MakeMethod ( F, homeObject )
- 10.2.8 DefineMethodProperty ( homeObject, key, closure, enumerable )
- 10.2.9 SetFunctionName ( F, name [ , prefix ] )
- 10.2.10 SetFunctionLength ( F, length )
- 10.2.11 FunctionDeclarationInstantiation ( func, argumentsList )
- +10.3 Built-in Function Objects
- +10.4 Built-in Exotic Object Internal Methods and Slots
- +10.4.1 Bound Function Exotic Objects
- +10.4.2 Array Exotic Objects
- +10.4.3 String Exotic Objects
- +10.4.4 Arguments Exotic Objects
- +10.4.5 TypedArray Exotic Objects
- 10.4.5.1 [[PreventExtensions]] ( )
- 10.4.5.2 [[GetOwnProperty]] ( P )
- 10.4.5.3 [[HasProperty]] ( P )
- 10.4.5.4 [[DefineOwnProperty]] ( P, Desc )
- 10.4.5.5 [[Get]] ( P, Receiver )
- 10.4.5.6 [[Set]] ( P, V, Receiver )
- 10.4.5.7 [[Delete]] ( P )
- 10.4.5.8 [[OwnPropertyKeys]] ( )
- 10.4.5.9 TypedArray With Buffer Witness Records
- 10.4.5.10 MakeTypedArrayWithBufferWitnessRecord ( obj, order )
- 10.4.5.11 TypedArrayCreate ( prototype )
- 10.4.5.12 TypedArrayByteLength ( taRecord )
- 10.4.5.13 TypedArrayLength ( taRecord )
- 10.4.5.14 IsTypedArrayOutOfBounds ( taRecord )
- 10.4.5.15 IsTypedArrayFixedLength ( O )
- 10.4.5.16 IsValidIntegerIndex ( O, index )
- 10.4.5.17 TypedArrayGetElement ( O, index )
- 10.4.5.18 TypedArraySetElement ( O, index, value )
- 10.4.5.19 IsArrayBufferViewOutOfBounds ( O )
- +10.4.6 Module Namespace Exotic Objects
- 10.4.6.1 [[GetPrototypeOf]] ( )
- 10.4.6.2 [[SetPrototypeOf]] ( V )
- 10.4.6.3 [[IsExtensible]] ( )
- 10.4.6.4 [[PreventExtensions]] ( )
- 10.4.6.5 [[GetOwnProperty]] ( P )
- 10.4.6.6 [[DefineOwnProperty]] ( P, Desc )
- 10.4.6.7 [[HasProperty]] ( P )
- 10.4.6.8 [[Get]] ( P, Receiver )
- 10.4.6.9 [[Set]] ( P, V, Receiver )
- 10.4.6.10 [[Delete]] ( P )
- 10.4.6.11 [[OwnPropertyKeys]] ( )
- 10.4.6.12 ModuleNamespaceCreate ( module, exports )
- +10.4.7 Immutable Prototype Exotic Objects
- +10.5 Proxy Object Internal Methods and Internal Slots
- 10.5.1 [[GetPrototypeOf]] ( )
- 10.5.2 [[SetPrototypeOf]] ( V )
- 10.5.3 [[IsExtensible]] ( )
- 10.5.4 [[PreventExtensions]] ( )
- 10.5.5 [[GetOwnProperty]] ( P )
- 10.5.6 [[DefineOwnProperty]] ( P, Desc )
- 10.5.7 [[HasProperty]] ( P )
- 10.5.8 [[Get]] ( P, Receiver )
- 10.5.9 [[Set]] ( P, V, Receiver )
- 10.5.10 [[Delete]] ( P )
- 10.5.11 [[OwnPropertyKeys]] ( )
- 10.5.12 [[Call]] ( thisArgument, argumentsList )
- 10.5.13 [[Construct]] ( argumentsList, newTarget )
- 10.5.14 ValidateNonRevokedProxy ( proxy )
- 10.5.15 ProxyCreate ( target, handler )
- +10.1 Ordinary Object Internal Methods and Internal Slots
- +11 ECMAScript Language: Source Text
- +12 ECMAScript Language: Lexical Grammar
- 12.1 Unicode Format-Control Characters
- 12.2 White Space
- 12.3 Line Terminators
- 12.4 Comments
- 12.5 Hashbang Comments
- 12.6 Tokens
- +12.7 Names and Keywords
- 12.8 Punctuators
- +12.9 Literals
- +12.10 Automatic Semicolon Insertion
- +13 ECMAScript Language: Expressions
- +13.1 Identifiers
- +13.2 Primary Expression
- +13.3 Left-Hand-Side Expressions
- +13.3.1 Static Semantics
- +13.3.2 Property Accessors
- 13.3.3 EvaluatePropertyAccessWithExpressionKey ( baseValue, expression, strict )
- 13.3.4 EvaluatePropertyAccessWithIdentifierKey ( baseValue, identifierName, strict )
- +13.3.5 The
new
Operator - +13.3.6 Function Calls
- +13.3.7 The
super
Keyword - +13.3.8 Argument Lists
- +13.3.9 Optional Chains
- +13.3.10 Import Calls
- +13.3.11 Tagged Templates
- +13.3.12 Meta Properties
- +13.4 Update Expressions
- +13.5 Unary Operators
- +13.6 Exponentiation Operator
- +13.7 Multiplicative Operators
- +13.8 Additive Operators
- +13.9 Bitwise Shift Operators
- +13.10 Relational Operators
- +13.11 Equality Operators
- +13.12 Binary Bitwise Operators
- +13.13 Binary Logical Operators
- +13.14 Conditional Operator (
? :
) - +13.15 Assignment Operators
- +13.16 Comma Operator (
,
)
- +14 ECMAScript Language: Statements and Declarations
- +14.1 Statement Semantics
- +14.2 Block
- +14.3 Declarations and the Variable Statement
- +14.4 Empty Statement
- +14.5 Expression Statement
- +14.6 The
if
Statement - +14.7 Iteration Statements
- +14.7.1 Semantics
- +14.7.2 The
do
-while
Statement - +14.7.3 The
while
Statement - +14.7.4 The
for
Statement - +14.7.5 The
for
-in
,for
-of
, andfor
-await
-of
Statements- 14.7.5.1 SS: Early Errors
- 14.7.5.2 SS: IsDestructuring
- 14.7.5.3 RS: ForDeclarationBindingInitialization
- 14.7.5.4 RS: ForDeclarationBindingInstantiation
- 14.7.5.5 RS: ForInOfLoopEvaluation
- 14.7.5.6 ForIn/OfHeadEvaluation ( uninitializedBoundNames, expr, iterationKind )
- 14.7.5.7 ForIn/OfBodyEvaluation ( lhs, stmt, iteratorRecord, iterationKind, lhsKind, labelSet [ , iteratorKind ] )
- 14.7.5.8 RS: Evaluation
- 14.7.5.9 EnumerateObjectProperties ( O )
- +14.7.5.10 For-In Iterator Objects
- +14.8 The
continue
Statement - +14.9 The
break
Statement - +14.10 The
return
Statement - +14.11 The
with
Statement - +14.12 The
switch
Statement - +14.13 Labelled Statements
- +14.14 The
throw
Statement - +14.15 The
try
Statement - +14.16 The
debugger
Statement
- +15 ECMAScript Language: Functions and Classes
- +15.1 Parameter Lists
- +15.2 Function Definitions
- +15.3 Arrow Function Definitions
- +15.4 Method Definitions
- +15.5 Generator Function Definitions
- +15.6 Async Generator Function Definitions
- +15.7 Class Definitions
- 15.7.1 SS: Early Errors
- 15.7.2 SS: ClassElementKind
- 15.7.3 SS: ConstructorMethod
- 15.7.4 SS: IsStatic
- 15.7.5 SS: NonConstructorElements
- 15.7.6 SS: PrototypePropertyNameList
- 15.7.7 SS: AllPrivateIdentifiersValid
- 15.7.8 SS: PrivateBoundIdentifiers
- 15.7.9 SS: ContainsArguments
- 15.7.10 RS: ClassFieldDefinitionEvaluation
- 15.7.11 RS: ClassStaticBlockDefinitionEvaluation
- 15.7.12 RS: EvaluateClassStaticBlockBody
- 15.7.13 RS: ClassElementEvaluation
- 15.7.14 RS: ClassDefinitionEvaluation
- 15.7.15 RS: BindingClassDeclarationEvaluation
- 15.7.16 RS: Evaluation
- +15.8 Async Function Definitions
- +15.9 Async Arrow Function Definitions
- +15.10 Tail Position Calls
- +16 ECMAScript Language: Scripts and Modules
- +16.1 Scripts
- +16.2 Modules
- +16.2.1 Module Semantics
- 16.2.1.1 SS: Early Errors
- 16.2.1.2 SS: ImportedLocalNames ( importEntries )
- +16.2.1.3 ModuleRequest Records
- 16.2.1.4 SS: ModuleRequests
- +16.2.1.5 Abstract Module Records
- +16.2.1.6 Cyclic Module Records
- +16.2.1.7 Source Text Module Records
- +16.2.1.8 Synthetic Module Records
- 16.2.1.9 GetImportedModule ( referrer, request )
- 16.2.1.10 HostLoadImportedModule ( referrer, moduleRequest, hostDefined, payload )
- 16.2.1.11 FinishLoadingImportedModule ( referrer, moduleRequest, payload, result )
- +16.2.1.12 AllImportAttributesSupported ( attributes )
- 16.2.1.13 GetModuleNamespace ( module )
- 16.2.1.14 RS: Evaluation
- +16.2.2 Imports
- +16.2.3 Exports
- +16.2.1 Module Semantics
- +17 Error Handling and Language Extensions
- 18 ECMAScript Standard Built-in Objects
- +19 The Global Object
- +19.1 Value Properties of the Global Object
- +19.2 Function Properties of the Global Object
- +19.3 Constructor Properties of the Global Object
- 19.3.1 AggregateError ( . . . )
- 19.3.2 Array ( . . . )
- 19.3.3 ArrayBuffer ( . . . )
- 19.3.4 BigInt ( . . . )
- 19.3.5 BigInt64Array ( . . . )
- 19.3.6 BigUint64Array ( . . . )
- 19.3.7 Boolean ( . . . )
- 19.3.8 DataView ( . . . )
- 19.3.9 Date ( . . . )
- 19.3.10 Error ( . . . )
- 19.3.11 EvalError ( . . . )
- 19.3.12 FinalizationRegistry ( . . . )
- 19.3.13 Float16Array ( . . . )
- 19.3.14 Float32Array ( . . . )
- 19.3.15 Float64Array ( . . . )
- 19.3.16 Function ( . . . )
- 19.3.17 Int8Array ( . . . )
- 19.3.18 Int16Array ( . . . )
- 19.3.19 Int32Array ( . . . )
- 19.3.20 Iterator ( . . . )
- 19.3.21 Map ( . . . )
- 19.3.22 Number ( . . . )
- 19.3.23 Object ( . . . )
- 19.3.24 Promise ( . . . )
- 19.3.25 Proxy ( . . . )
- 19.3.26 RangeError ( . . . )
- 19.3.27 ReferenceError ( . . . )
- 19.3.28 RegExp ( . . . )
- 19.3.29 Set ( . . . )
- 19.3.30 SharedArrayBuffer ( . . . )
- 19.3.31 String ( . . . )
- 19.3.32 Symbol ( . . . )
- 19.3.33 SyntaxError ( . . . )
- 19.3.34 TypeError ( . . . )
- 19.3.35 Uint8Array ( . . . )
- 19.3.36 Uint8ClampedArray ( . . . )
- 19.3.37 Uint16Array ( . . . )
- 19.3.38 Uint32Array ( . . . )
- 19.3.39 URIError ( . . . )
- 19.3.40 WeakMap ( . . . )
- 19.3.41 WeakRef ( . . . )
- 19.3.42 WeakSet ( . . . )
- +19.4 Other Properties of the Global Object
- +20 Fundamental Objects
- +20.1 Object Objects
- +20.1.1 The Object Constructor
- +20.1.2 Properties of the Object Constructor
- 20.1.2.1 Object.assign ( target, ...sources )
- 20.1.2.2 Object.create ( O, Properties )
- +20.1.2.3 Object.defineProperties ( O, Properties )
- 20.1.2.4 Object.defineProperty ( O, P, Attributes )
- 20.1.2.5 Object.entries ( O )
- 20.1.2.6 Object.freeze ( O )
- 20.1.2.7 Object.fromEntries ( iterable )
- 20.1.2.8 Object.getOwnPropertyDescriptor ( O, P )
- 20.1.2.9 Object.getOwnPropertyDescriptors ( O )
- 20.1.2.10 Object.getOwnPropertyNames ( O )
- +20.1.2.11 Object.getOwnPropertySymbols ( O )
- 20.1.2.12 Object.getPrototypeOf ( O )
- 20.1.2.13 Object.groupBy ( items, callback )
- 20.1.2.14 Object.hasOwn ( O, P )
- 20.1.2.15 Object.is ( value1, value2 )
- 20.1.2.16 Object.isExtensible ( O )
- 20.1.2.17 Object.isFrozen ( O )
- 20.1.2.18 Object.isSealed ( O )
- 20.1.2.19 Object.keys ( O )
- 20.1.2.20 Object.preventExtensions ( O )
- 20.1.2.21 Object.prototype
- 20.1.2.22 Object.seal ( O )
- 20.1.2.23 Object.setPrototypeOf ( O, proto )
- 20.1.2.24 Object.values ( O )
- +20.1.3 Properties of the Object Prototype Object
- 20.1.3.1 Object.prototype.constructor
- 20.1.3.2 Object.prototype.hasOwnProperty ( V )
- 20.1.3.3 Object.prototype.isPrototypeOf ( V )
- 20.1.3.4 Object.prototype.propertyIsEnumerable ( V )
- 20.1.3.5 Object.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
- 20.1.3.6 Object.prototype.toString ( )
- 20.1.3.7 Object.prototype.valueOf ( )
- +20.1.3.8 Object.prototype.__proto__
- +20.1.3.9 Legacy Object.prototype Accessor Methods
- 20.1.4 Properties of Object Instances
- +20.2 Function Objects
- +20.3 Boolean Objects
- +20.4 Symbol Objects
- +20.4.1 The Symbol Constructor
- +20.4.2 Properties of the Symbol Constructor
- 20.4.2.1 Symbol.asyncIterator
- 20.4.2.2 Symbol.for ( key )
- 20.4.2.3 Symbol.hasInstance
- 20.4.2.4 Symbol.isConcatSpreadable
- 20.4.2.5 Symbol.iterator
- 20.4.2.6 Symbol.keyFor ( sym )
- 20.4.2.7 Symbol.match
- 20.4.2.8 Symbol.matchAll
- 20.4.2.9 Symbol.prototype
- 20.4.2.10 Symbol.replace
- 20.4.2.11 Symbol.search
- 20.4.2.12 Symbol.species
- 20.4.2.13 Symbol.split
- 20.4.2.14 Symbol.toPrimitive
- 20.4.2.15 Symbol.toStringTag
- 20.4.2.16 Symbol.unscopables
- +20.4.3 Properties of the Symbol Prototype Object
- 20.4.4 Properties of Symbol Instances
- +20.4.5 Abstract Operations for Symbols
- +20.5 Error Objects
- +20.5.1 The Error Constructor
- +20.5.2 Properties of the Error Constructor
- +20.5.3 Properties of the Error Prototype Object
- 20.5.4 Properties of Error Instances
- +20.5.5 Native Error Types Used in This Standard
- +20.5.6 NativeError Object Structure
- +20.5.7 AggregateError Objects
- +20.5.8 Abstract Operations for Error Objects
- +20.1 Object Objects
- +21 Numbers and Dates
- +21.1 Number Objects
- +21.1.1 The Number Constructor
- +21.1.2 Properties of the Number Constructor
- 21.1.2.1 Number.EPSILON
- 21.1.2.2 Number.isFinite ( number )
- 21.1.2.3 Number.isInteger ( number )
- 21.1.2.4 Number.isNaN ( number )
- 21.1.2.5 Number.isSafeInteger ( number )
- 21.1.2.6 Number.MAX_SAFE_INTEGER
- 21.1.2.7 Number.MAX_VALUE
- 21.1.2.8 Number.MIN_SAFE_INTEGER
- 21.1.2.9 Number.MIN_VALUE
- 21.1.2.10 Number.NaN
- 21.1.2.11 Number.NEGATIVE_INFINITY
- 21.1.2.12 Number.parseFloat ( string )
- 21.1.2.13 Number.parseInt ( string, radix )
- 21.1.2.14 Number.POSITIVE_INFINITY
- 21.1.2.15 Number.prototype
- +21.1.3 Properties of the Number Prototype Object
- 21.1.3.1 Number.prototype.constructor
- 21.1.3.2 Number.prototype.toExponential ( fractionDigits )
- 21.1.3.3 Number.prototype.toFixed ( fractionDigits )
- 21.1.3.4 Number.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
- 21.1.3.5 Number.prototype.toPrecision ( precision )
- 21.1.3.6 Number.prototype.toString ( [ radix ] )
- +21.1.3.7 Number.prototype.valueOf ( )
- 21.1.4 Properties of Number Instances
- +21.2 BigInt Objects
- +21.3 The Math Object
- +21.3.1 Value Properties of the Math Object
- +21.3.2 Function Properties of the Math Object
- 21.3.2.1 Math.abs ( x )
- 21.3.2.2 Math.acos ( x )
- 21.3.2.3 Math.acosh ( x )
- 21.3.2.4 Math.asin ( x )
- 21.3.2.5 Math.asinh ( x )
- 21.3.2.6 Math.atan ( x )
- 21.3.2.7 Math.atanh ( x )
- 21.3.2.8 Math.atan2 ( y, x )
- 21.3.2.9 Math.cbrt ( x )
- 21.3.2.10 Math.ceil ( x )
- 21.3.2.11 Math.clz32 ( x )
- 21.3.2.12 Math.cos ( x )
- 21.3.2.13 Math.cosh ( x )
- 21.3.2.14 Math.exp ( x )
- 21.3.2.15 Math.expm1 ( x )
- 21.3.2.16 Math.floor ( x )
- 21.3.2.17 Math.fround ( x )
- 21.3.2.18 Math.f16round ( x )
- 21.3.2.19 Math.hypot ( ...args )
- 21.3.2.20 Math.imul ( x, y )
- 21.3.2.21 Math.log ( x )
- 21.3.2.22 Math.log1p ( x )
- 21.3.2.23 Math.log10 ( x )
- 21.3.2.24 Math.log2 ( x )
- 21.3.2.25 Math.max ( ...args )
- 21.3.2.26 Math.min ( ...args )
- 21.3.2.27 Math.pow ( base, exponent )
- 21.3.2.28 Math.random ( )
- 21.3.2.29 Math.round ( x )
- 21.3.2.30 Math.sign ( x )
- 21.3.2.31 Math.sin ( x )
- 21.3.2.32 Math.sinh ( x )
- 21.3.2.33 Math.sqrt ( x )
- 21.3.2.34 Math.tan ( x )
- 21.3.2.35 Math.tanh ( x )
- 21.3.2.36 Math.trunc ( x )
- +21.4 Date Objects
- +21.4.1 Overview of Date Objects and Definitions of Abstract Operations
- 21.4.1.1 Time Values and Time Range
- 21.4.1.2 Time-related Constants
- 21.4.1.3 Day ( t )
- 21.4.1.4 TimeWithinDay ( t )
- 21.4.1.5 DaysInYear ( y )
- 21.4.1.6 DayFromYear ( y )
- 21.4.1.7 TimeFromYear ( y )
- 21.4.1.8 YearFromTime ( t )
- 21.4.1.9 DayWithinYear ( t )
- 21.4.1.10 InLeapYear ( t )
- 21.4.1.11 MonthFromTime ( t )
- 21.4.1.12 DateFromTime ( t )
- 21.4.1.13 WeekDay ( t )
- 21.4.1.14 HourFromTime ( t )
- 21.4.1.15 MinFromTime ( t )
- 21.4.1.16 SecFromTime ( t )
- 21.4.1.17 msFromTime ( t )
- 21.4.1.18 GetUTCEpochNanoseconds ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond )
- 21.4.1.19 Time Zone Identifiers
- 21.4.1.20 GetNamedTimeZoneEpochNanoseconds ( timeZoneIdentifier, year, month, day, hour, minute, second, millisecond, microsecond, nanosecond )
- 21.4.1.21 GetNamedTimeZoneOffsetNanoseconds ( timeZoneIdentifier, epochNanoseconds )
- 21.4.1.22 Time Zone Identifier Record
- 21.4.1.23 AvailableNamedTimeZoneIdentifiers ( )
- 21.4.1.24 SystemTimeZoneIdentifier ( )
- 21.4.1.25 LocalTime ( t )
- 21.4.1.26 UTC ( t )
- 21.4.1.27 MakeTime ( hour, min, sec, ms )
- 21.4.1.28 MakeDay ( year, month, date )
- 21.4.1.29 MakeDate ( day, time )
- 21.4.1.30 MakeFullYear ( year )
- 21.4.1.31 TimeClip ( time )
- +21.4.1.32 Date Time String Format
- +21.4.1.33 Time Zone Offset String Format
- +21.4.2 The Date Constructor
- +21.4.3 Properties of the Date Constructor
- +21.4.4 Properties of the Date Prototype Object
- 21.4.4.1 Date.prototype.constructor
- 21.4.4.2 Date.prototype.getDate ( )
- 21.4.4.3 Date.prototype.getDay ( )
- 21.4.4.4 Date.prototype.getFullYear ( )
- 21.4.4.5 Date.prototype.getHours ( )
- 21.4.4.6 Date.prototype.getMilliseconds ( )
- 21.4.4.7 Date.prototype.getMinutes ( )
- 21.4.4.8 Date.prototype.getMonth ( )
- 21.4.4.9 Date.prototype.getSeconds ( )
- 21.4.4.10 Date.prototype.getTime ( )
- 21.4.4.11 Date.prototype.getTimezoneOffset ( )
- 21.4.4.12 Date.prototype.getUTCDate ( )
- 21.4.4.13 Date.prototype.getUTCDay ( )
- 21.4.4.14 Date.prototype.getUTCFullYear ( )
- 21.4.4.15 Date.prototype.getUTCHours ( )
- 21.4.4.16 Date.prototype.getUTCMilliseconds ( )
- 21.4.4.17 Date.prototype.getUTCMinutes ( )
- 21.4.4.18 Date.prototype.getUTCMonth ( )
- 21.4.4.19 Date.prototype.getUTCSeconds ( )
- 21.4.4.20 Date.prototype.setDate ( date )
- 21.4.4.21 Date.prototype.setFullYear ( year [ , month [ , date ] ] )
- 21.4.4.22 Date.prototype.setHours ( hour [ , min [ , sec [ , ms ] ] ] )
- 21.4.4.23 Date.prototype.setMilliseconds ( ms )
- 21.4.4.24 Date.prototype.setMinutes ( min [ , sec [ , ms ] ] )
- 21.4.4.25 Date.prototype.setMonth ( month [ , date ] )
- 21.4.4.26 Date.prototype.setSeconds ( sec [ , ms ] )
- 21.4.4.27 Date.prototype.setTime ( time )
- 21.4.4.28 Date.prototype.setUTCDate ( date )
- 21.4.4.29 Date.prototype.setUTCFullYear ( year [ , month [ , date ] ] )
- 21.4.4.30 Date.prototype.setUTCHours ( hour [ , min [ , sec [ , ms ] ] ] )
- 21.4.4.31 Date.prototype.setUTCMilliseconds ( ms )
- 21.4.4.32 Date.prototype.setUTCMinutes ( min [ , sec [ , ms ] ] )
- 21.4.4.33 Date.prototype.setUTCMonth ( month [ , date ] )
- 21.4.4.34 Date.prototype.setUTCSeconds ( sec [ , ms ] )
- 21.4.4.35 Date.prototype.toDateString ( )
- 21.4.4.36 Date.prototype.toISOString ( )
- 21.4.4.37 Date.prototype.toJSON ( key )
- 21.4.4.38 Date.prototype.toLocaleDateString ( [ reserved1 [ , reserved2 ] ] )
- 21.4.4.39 Date.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
- 21.4.4.40 Date.prototype.toLocaleTimeString ( [ reserved1 [ , reserved2 ] ] )
- +21.4.4.41 Date.prototype.toString ( )
- 21.4.4.42 Date.prototype.toTimeString ( )
- 21.4.4.43 Date.prototype.toUTCString ( )
- 21.4.4.44 Date.prototype.valueOf ( )
- 21.4.4.45 Date.prototype [ %Symbol.toPrimitive% ] ( hint )
- 21.4.5 Properties of Date Instances
- +21.4.1 Overview of Date Objects and Definitions of Abstract Operations
- +21.1 Number Objects
- +22 Text Processing
- +22.1 String Objects
- +22.1.1 The String Constructor
- +22.1.2 Properties of the String Constructor
- +22.1.3 Properties of the String Prototype Object
- 22.1.3.1 String.prototype.at ( index )
- 22.1.3.2 String.prototype.charAt ( pos )
- 22.1.3.3 String.prototype.charCodeAt ( pos )
- 22.1.3.4 String.prototype.codePointAt ( pos )
- 22.1.3.5 String.prototype.concat ( ...args )
- 22.1.3.6 String.prototype.constructor
- 22.1.3.7 String.prototype.endsWith ( searchString [ , endPosition ] )
- 22.1.3.8 String.prototype.includes ( searchString [ , position ] )
- 22.1.3.9 String.prototype.indexOf ( searchString [ , position ] )
- 22.1.3.10 String.prototype.isWellFormed ( )
- 22.1.3.11 String.prototype.lastIndexOf ( searchString [ , position ] )
- 22.1.3.12 String.prototype.localeCompare ( that [ , reserved1 [ , reserved2 ] ] )
- 22.1.3.13 String.prototype.match ( regexp )
- 22.1.3.14 String.prototype.matchAll ( regexp )
- 22.1.3.15 String.prototype.normalize ( [ form ] )
- 22.1.3.16 String.prototype.padEnd ( maxLength [ , fillString ] )
- +22.1.3.17 String.prototype.padStart ( maxLength [ , fillString ] )
- 22.1.3.18 String.prototype.repeat ( count )
- +22.1.3.19 String.prototype.replace ( searchValue, replaceValue )
- 22.1.3.20 String.prototype.replaceAll ( searchValue, replaceValue )
- 22.1.3.21 String.prototype.search ( regexp )
- 22.1.3.22 String.prototype.slice ( start, end )
- 22.1.3.23 String.prototype.split ( separator, limit )
- 22.1.3.24 String.prototype.startsWith ( searchString [ , position ] )
- 22.1.3.25 String.prototype.substring ( start, end )
- 22.1.3.26 String.prototype.toLocaleLowerCase ( [ reserved1 [ , reserved2 ] ] )
- 22.1.3.27 String.prototype.toLocaleUpperCase ( [ reserved1 [ , reserved2 ] ] )
- 22.1.3.28 String.prototype.toLowerCase ( )
- 22.1.3.29 String.prototype.toString ( )
- 22.1.3.30 String.prototype.toUpperCase ( )
- 22.1.3.31 String.prototype.toWellFormed ( )
- +22.1.3.32 String.prototype.trim ( )
- 22.1.3.33 String.prototype.trimEnd ( )
- 22.1.3.34 String.prototype.trimStart ( )
- +22.1.3.35 String.prototype.valueOf ( )
- 22.1.3.36 String.prototype [ %Symbol.iterator% ] ( )
- +22.1.4 Properties of String Instances
- +22.1.5 String Iterator Objects
- +22.2 RegExp (Regular Expression) Objects
- +22.2.1 Patterns
- 22.2.1.1 SS: Early Errors
- 22.2.1.2 SS: CountLeftCapturingParensWithin ( node )
- 22.2.1.3 SS: CountLeftCapturingParensBefore ( node )
- 22.2.1.4 SS: MightBothParticipate ( x, y )
- 22.2.1.5 SS: CapturingGroupNumber
- 22.2.1.6 SS: IsCharacterClass
- 22.2.1.7 SS: CharacterValue
- 22.2.1.8 SS: MayContainStrings
- 22.2.1.9 SS: GroupSpecifiersThatMatch ( thisGroupName )
- 22.2.1.10 SS: CapturingGroupName
- 22.2.1.11 SS: RegExpIdentifierCodePoints
- 22.2.1.12 SS: RegExpIdentifierCodePoint
- +22.2.2 Pattern Semantics
- +22.2.2.1 Notation
- 22.2.2.2 RS: CompilePattern
- +22.2.2.3 RS: CompileSubpattern
- +22.2.2.4 RS: CompileAssertion
- 22.2.2.5 RS: CompileQuantifier
- 22.2.2.6 RS: CompileQuantifierPrefix
- +22.2.2.7 RS: CompileAtom
- 22.2.2.8 RS: CompileCharacterClass
- +22.2.2.9 RS: CompileToCharSet
- 22.2.2.9.1 CharacterRange ( A, B )
- 22.2.2.9.2 HasEitherUnicodeFlag ( rer )
- 22.2.2.9.3 WordCharacters ( rer )
- 22.2.2.9.4 AllCharacters ( rer )
- 22.2.2.9.5 MaybeSimpleCaseFolding ( rer, A )
- 22.2.2.9.6 CharacterComplement ( rer, S )
- 22.2.2.9.7 UnicodeMatchProperty ( rer, p )
- 22.2.2.9.8 UnicodeMatchPropertyValue ( p, v )
- 22.2.2.10 RS: CompileClassSetString
- +22.2.3 Abstract Operations for RegExp Creation
- +22.2.4 The RegExp Constructor
- +22.2.5 Properties of the RegExp Constructor
- +22.2.6 Properties of the RegExp Prototype Object
- 22.2.6.1 RegExp.prototype.constructor
- 22.2.6.2 RegExp.prototype.exec ( string )
- 22.2.6.3 get RegExp.prototype.dotAll
- +22.2.6.4 get RegExp.prototype.flags
- 22.2.6.5 get RegExp.prototype.global
- 22.2.6.6 get RegExp.prototype.hasIndices
- 22.2.6.7 get RegExp.prototype.ignoreCase
- 22.2.6.8 RegExp.prototype [ %Symbol.match% ] ( string )
- 22.2.6.9 RegExp.prototype [ %Symbol.matchAll% ] ( string )
- 22.2.6.10 get RegExp.prototype.multiline
- 22.2.6.11 RegExp.prototype [ %Symbol.replace% ] ( string, replaceValue )
- 22.2.6.12 RegExp.prototype [ %Symbol.search% ] ( string )
- +22.2.6.13 get RegExp.prototype.source
- 22.2.6.14 RegExp.prototype [ %Symbol.split% ] ( string, limit )
- 22.2.6.15 get RegExp.prototype.sticky
- 22.2.6.16 RegExp.prototype.test ( S )
- 22.2.6.17 RegExp.prototype.toString ( )
- 22.2.6.18 get RegExp.prototype.unicode
- 22.2.6.19 get RegExp.prototype.unicodeSets
- +22.2.7 Abstract Operations for RegExp Matching
- 22.2.7.1 RegExpExec ( R, S )
- 22.2.7.2 RegExpBuiltinExec ( R, S )
- 22.2.7.3 AdvanceStringIndex ( S, index, unicode )
- 22.2.7.4 GetStringIndex ( S, codePointIndex )
- 22.2.7.5 Match Records
- 22.2.7.6 GetMatchString ( S, match )
- 22.2.7.7 GetMatchIndexPair ( S, match )
- 22.2.7.8 MakeMatchIndicesIndexPairArray ( S, indices, groupNames, hasGroups )
- +22.2.8 Properties of RegExp Instances
- +22.2.9 RegExp String Iterator Objects
- +22.2.1 Patterns
- +22.1 String Objects
- +23 Indexed Collections
- +23.1 Array Objects
- +23.1.1 The Array Constructor
- +23.1.2 Properties of the Array Constructor
- +23.1.3 Properties of the Array Prototype Object
- 23.1.3.1 Array.prototype.at ( index )
- +23.1.3.2 Array.prototype.concat ( ...items )
- 23.1.3.3 Array.prototype.constructor
- 23.1.3.4 Array.prototype.copyWithin ( target, start [ , end ] )
- 23.1.3.5 Array.prototype.entries ( )
- 23.1.3.6 Array.prototype.every ( callback [ , thisArg ] )
- 23.1.3.7 Array.prototype.fill ( value [ , start [ , end ] ] )
- 23.1.3.8 Array.prototype.filter ( callback [ , thisArg ] )
- 23.1.3.9 Array.prototype.find ( predicate [ , thisArg ] )
- 23.1.3.10 Array.prototype.findIndex ( predicate [ , thisArg ] )
- 23.1.3.11 Array.prototype.findLast ( predicate [ , thisArg ] )
- +23.1.3.12 Array.prototype.findLastIndex ( predicate [ , thisArg ] )
- +23.1.3.13 Array.prototype.flat ( [ depth ] )
- 23.1.3.14 Array.prototype.flatMap ( mapperFunction [ , thisArg ] )
- 23.1.3.15 Array.prototype.forEach ( callback [ , thisArg ] )
- 23.1.3.16 Array.prototype.includes ( searchElement [ , fromIndex ] )
- 23.1.3.17 Array.prototype.indexOf ( searchElement [ , fromIndex ] )
- 23.1.3.18 Array.prototype.join ( separator )
- 23.1.3.19 Array.prototype.keys ( )
- 23.1.3.20 Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] )
- 23.1.3.21 Array.prototype.map ( callback [ , thisArg ] )
- 23.1.3.22 Array.prototype.pop ( )
- 23.1.3.23 Array.prototype.push ( ...items )
- 23.1.3.24 Array.prototype.reduce ( callback [ , initialValue ] )
- 23.1.3.25 Array.prototype.reduceRight ( callback [ , initialValue ] )
- 23.1.3.26 Array.prototype.reverse ( )
- 23.1.3.27 Array.prototype.shift ( )
- 23.1.3.28 Array.prototype.slice ( start, end )
- 23.1.3.29 Array.prototype.some ( callback [ , thisArg ] )
- +23.1.3.30 Array.prototype.sort ( comparator )
- 23.1.3.31 Array.prototype.splice ( start, deleteCount, ...items )
- 23.1.3.32 Array.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
- 23.1.3.33 Array.prototype.toReversed ( )
- 23.1.3.34 Array.prototype.toSorted ( comparator )
- 23.1.3.35 Array.prototype.toSpliced ( start, skipCount, ...items )
- 23.1.3.36 Array.prototype.toString ( )
- 23.1.3.37 Array.prototype.unshift ( ...items )
- 23.1.3.38 Array.prototype.values ( )
- 23.1.3.39 Array.prototype.with ( index, value )
- 23.1.3.40 Array.prototype [ %Symbol.iterator% ] ( )
- 23.1.3.41 Array.prototype [ %Symbol.unscopables% ]
- +23.1.4 Properties of Array Instances
- +23.1.5 Array Iterator Objects
- +23.2 TypedArray Objects
- +23.2.1 The %TypedArray% Intrinsic Object
- +23.2.2 Properties of the %TypedArray% Intrinsic Object
- +23.2.3 Properties of the %TypedArray% Prototype Object
- 23.2.3.1 %TypedArray%.prototype.at ( index )
- 23.2.3.2 get %TypedArray%.prototype.buffer
- 23.2.3.3 get %TypedArray%.prototype.byteLength
- 23.2.3.4 get %TypedArray%.prototype.byteOffset
- 23.2.3.5 %TypedArray%.prototype.constructor
- 23.2.3.6 %TypedArray%.prototype.copyWithin ( target, start [ , end ] )
- 23.2.3.7 %TypedArray%.prototype.entries ( )
- 23.2.3.8 %TypedArray%.prototype.every ( callback [ , thisArg ] )
- 23.2.3.9 %TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
- 23.2.3.10 %TypedArray%.prototype.filter ( callback [ , thisArg ] )
- 23.2.3.11 %TypedArray%.prototype.find ( predicate [ , thisArg ] )
- 23.2.3.12 %TypedArray%.prototype.findIndex ( predicate [ , thisArg ] )
- 23.2.3.13 %TypedArray%.prototype.findLast ( predicate [ , thisArg ] )
- 23.2.3.14 %TypedArray%.prototype.findLastIndex ( predicate [ , thisArg ] )
- 23.2.3.15 %TypedArray%.prototype.forEach ( callback [ , thisArg ] )
- 23.2.3.16 %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] )
- 23.2.3.17 %TypedArray%.prototype.indexOf ( searchElement [ , fromIndex ] )
- 23.2.3.18 %TypedArray%.prototype.join ( separator )
- 23.2.3.19 %TypedArray%.prototype.keys ( )
- 23.2.3.20 %TypedArray%.prototype.lastIndexOf ( searchElement [ , fromIndex ] )
- 23.2.3.21 get %TypedArray%.prototype.length
- 23.2.3.22 %TypedArray%.prototype.map ( callback [ , thisArg ] )
- 23.2.3.23 %TypedArray%.prototype.reduce ( callback [ , initialValue ] )
- 23.2.3.24 %TypedArray%.prototype.reduceRight ( callback [ , initialValue ] )
- 23.2.3.25 %TypedArray%.prototype.reverse ( )
- +23.2.3.26 %TypedArray%.prototype.set ( source [ , offset ] )
- 23.2.3.27 %TypedArray%.prototype.slice ( start, end )
- 23.2.3.28 %TypedArray%.prototype.some ( callback [ , thisArg ] )
- 23.2.3.29 %TypedArray%.prototype.sort ( comparator )
- 23.2.3.30 %TypedArray%.prototype.subarray ( start, end )
- 23.2.3.31 %TypedArray%.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
- 23.2.3.32 %TypedArray%.prototype.toReversed ( )
- 23.2.3.33 %TypedArray%.prototype.toSorted ( comparator )
- 23.2.3.34 %TypedArray%.prototype.toString ( )
- 23.2.3.35 %TypedArray%.prototype.values ( )
- 23.2.3.36 %TypedArray%.prototype.with ( index, value )
- 23.2.3.37 %TypedArray%.prototype [ %Symbol.iterator% ] ( )
- 23.2.3.38 get %TypedArray%.prototype [ %Symbol.toStringTag% ]
- +23.2.4 Abstract Operations for TypedArray Objects
- 23.2.4.1 TypedArrayCreateFromConstructor ( constructor, argumentList )
- 23.2.4.2 TypedArrayCreateSameType ( exemplar, argumentList )
- 23.2.4.3 TypedArraySpeciesCreate ( exemplar, argumentList )
- 23.2.4.4 ValidateTypedArray ( O, order )
- 23.2.4.5 TypedArrayElementSize ( O )
- 23.2.4.6 TypedArrayElementType ( O )
- 23.2.4.7 CompareTypedArrayElements ( x, y, comparator )
- +23.2.5 The TypedArray Constructors
- +23.2.5.1 TypedArray ( ...args )
- 23.2.5.1.1 AllocateTypedArray ( constructorName, newTarget, defaultProto [ , length ] )
- 23.2.5.1.2 InitializeTypedArrayFromTypedArray ( O, srcArray )
- 23.2.5.1.3 InitializeTypedArrayFromArrayBuffer ( O, buffer, byteOffset, length )
- 23.2.5.1.4 InitializeTypedArrayFromList ( O, values )
- 23.2.5.1.5 InitializeTypedArrayFromArrayLike ( O, arrayLike )
- 23.2.5.1.6 AllocateTypedArrayBuffer ( O, length )
- +23.2.5.1 TypedArray ( ...args )
- +23.2.6 Properties of the TypedArray Constructors
- +23.2.7 Properties of the TypedArray Prototype Objects
- 23.2.8 Properties of TypedArray Instances
- +23.1 Array Objects
- +24 Keyed Collections
- +24.1 Map Objects
- +24.1.1 The Map Constructor
- +24.1.2 Properties of the Map Constructor
- +24.1.3 Properties of the Map Prototype Object
- 24.1.3.1 Map.prototype.clear ( )
- 24.1.3.2 Map.prototype.constructor
- 24.1.3.3 Map.prototype.delete ( key )
- 24.1.3.4 Map.prototype.entries ( )
- 24.1.3.5 Map.prototype.forEach ( callback [ , thisArg ] )
- 24.1.3.6 Map.prototype.get ( key )
- 24.1.3.7 Map.prototype.has ( key )
- 24.1.3.8 Map.prototype.keys ( )
- 24.1.3.9 Map.prototype.set ( key, value )
- 24.1.3.10 get Map.prototype.size
- 24.1.3.11 Map.prototype.values ( )
- 24.1.3.12 Map.prototype [ %Symbol.iterator% ] ( )
- 24.1.3.13 Map.prototype [ %Symbol.toStringTag% ]
- 24.1.4 Properties of Map Instances
- +24.1.5 Map Iterator Objects
- +24.2 Set Objects
- +24.2.1 Abstract Operations For Set Objects
- +24.2.2 The Set Constructor
- +24.2.3 Properties of the Set Constructor
- +24.2.4 Properties of the Set Prototype Object
- 24.2.4.1 Set.prototype.add ( value )
- 24.2.4.2 Set.prototype.clear ( )
- 24.2.4.3 Set.prototype.constructor
- 24.2.4.4 Set.prototype.delete ( value )
- 24.2.4.5 Set.prototype.difference ( other )
- 24.2.4.6 Set.prototype.entries ( )
- 24.2.4.7 Set.prototype.forEach ( callback [ , thisArg ] )
- 24.2.4.8 Set.prototype.has ( value )
- 24.2.4.9 Set.prototype.intersection ( other )
- 24.2.4.10 Set.prototype.isDisjointFrom ( other )
- 24.2.4.11 Set.prototype.isSubsetOf ( other )
- 24.2.4.12 Set.prototype.isSupersetOf ( other )
- 24.2.4.13 Set.prototype.keys ( )
- 24.2.4.14 get Set.prototype.size
- 24.2.4.15 Set.prototype.symmetricDifference ( other )
- 24.2.4.16 Set.prototype.union ( other )
- 24.2.4.17 Set.prototype.values ( )
- 24.2.4.18 Set.prototype [ %Symbol.iterator% ] ( )
- 24.2.4.19 Set.prototype [ %Symbol.toStringTag% ]
- 24.2.5 Properties of Set Instances
- +24.2.6 Set Iterator Objects
- +24.3 WeakMap Objects
- +24.4 WeakSet Objects
- +24.5 Abstract Operations for Keyed Collections
- +24.1 Map Objects
- +25 Structured Data
- +25.1 ArrayBuffer Objects
- 25.1.1 Notation
- 25.1.2 Fixed-length and Resizable ArrayBuffer Objects
- +25.1.3 Abstract Operations For ArrayBuffer Objects
- 25.1.3.1 AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] )
- 25.1.3.2 ArrayBufferByteLength ( arrayBuffer, order )
- 25.1.3.3 ArrayBufferCopyAndDetach ( arrayBuffer, newLength, preserveResizability )
- 25.1.3.4 IsDetachedBuffer ( arrayBuffer )
- 25.1.3.5 DetachArrayBuffer ( arrayBuffer [ , key ] )
- 25.1.3.6 CloneArrayBuffer ( srcBuffer, srcByteOffset, srcLength )
- 25.1.3.7 GetArrayBufferMaxByteLengthOption ( options )
- 25.1.3.8 HostResizeArrayBuffer ( buffer, newByteLength )
- 25.1.3.9 IsFixedLengthArrayBuffer ( arrayBuffer )
- 25.1.3.10 IsUnsignedElementType ( type )
- 25.1.3.11 IsUnclampedIntegerElementType ( type )
- 25.1.3.12 IsBigIntElementType ( type )
- 25.1.3.13 IsNoTearConfiguration ( type, order )
- 25.1.3.14 RawBytesToNumeric ( type, rawBytes, isLittleEndian )
- 25.1.3.15 GetRawBytesFromSharedBlock ( block, byteIndex, type, isTypedArray, order )
- 25.1.3.16 GetValueFromBuffer ( arrayBuffer, byteIndex, type, isTypedArray, order [ , isLittleEndian ] )
- 25.1.3.17 NumericToRawBytes ( type, value, isLittleEndian )
- 25.1.3.18 SetValueInBuffer ( arrayBuffer, byteIndex, type, value, isTypedArray, order [ , isLittleEndian ] )
- 25.1.3.19 GetModifySetValueInBuffer ( arrayBuffer, byteIndex, type, value, op )
- +25.1.4 The ArrayBuffer Constructor
- +25.1.5 Properties of the ArrayBuffer Constructor
- +25.1.6 Properties of the ArrayBuffer Prototype Object
- 25.1.6.1 get ArrayBuffer.prototype.byteLength
- 25.1.6.2 ArrayBuffer.prototype.constructor
- 25.1.6.3 get ArrayBuffer.prototype.detached
- 25.1.6.4 get ArrayBuffer.prototype.maxByteLength
- 25.1.6.5 get ArrayBuffer.prototype.resizable
- 25.1.6.6 ArrayBuffer.prototype.resize ( newLength )
- 25.1.6.7 ArrayBuffer.prototype.slice ( start, end )
- 25.1.6.8 ArrayBuffer.prototype.transfer ( [ newLength ] )
- 25.1.6.9 ArrayBuffer.prototype.transferToFixedLength ( [ newLength ] )
- 25.1.6.10 ArrayBuffer.prototype [ %Symbol.toStringTag% ]
- 25.1.7 Properties of ArrayBuffer Instances
- 25.1.8 Resizable ArrayBuffer Guidelines
- +25.2 SharedArrayBuffer Objects
- 25.2.1 Fixed-length and Growable SharedArrayBuffer Objects
- +25.2.2 Abstract Operations for SharedArrayBuffer Objects
- +25.2.3 The SharedArrayBuffer Constructor
- +25.2.4 Properties of the SharedArrayBuffer Constructor
- +25.2.5 Properties of the SharedArrayBuffer Prototype Object
- 25.2.5.1 get SharedArrayBuffer.prototype.byteLength
- 25.2.5.2 SharedArrayBuffer.prototype.constructor
- 25.2.5.3 SharedArrayBuffer.prototype.grow ( newLength )
- 25.2.5.4 get SharedArrayBuffer.prototype.growable
- 25.2.5.5 get SharedArrayBuffer.prototype.maxByteLength
- 25.2.5.6 SharedArrayBuffer.prototype.slice ( start, end )
- 25.2.5.7 SharedArrayBuffer.prototype [ %Symbol.toStringTag% ]
- 25.2.6 Properties of SharedArrayBuffer Instances
- 25.2.7 Growable SharedArrayBuffer Guidelines
- +25.3 DataView Objects
- +25.3.1 Abstract Operations For DataView Objects
- 25.3.1.1 DataView With Buffer Witness Records
- 25.3.1.2 MakeDataViewWithBufferWitnessRecord ( obj, order )
- 25.3.1.3 GetViewByteLength ( viewRecord )
- 25.3.1.4 IsViewOutOfBounds ( viewRecord )
- 25.3.1.5 GetViewValue ( view, requestIndex, isLittleEndian, type )
- 25.3.1.6 SetViewValue ( view, requestIndex, isLittleEndian, type, value )
- +25.3.2 The DataView Constructor
- +25.3.3 Properties of the DataView Constructor
- +25.3.4 Properties of the DataView Prototype Object
- 25.3.4.1 get DataView.prototype.buffer
- 25.3.4.2 get DataView.prototype.byteLength
- 25.3.4.3 get DataView.prototype.byteOffset
- 25.3.4.4 DataView.prototype.constructor
- 25.3.4.5 DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
- 25.3.4.6 DataView.prototype.getBigUint64 ( byteOffset [ , littleEndian ] )
- 25.3.4.7 DataView.prototype.getFloat16 ( byteOffset [ , littleEndian ] )
- 25.3.4.8 DataView.prototype.getFloat32 ( byteOffset [ , littleEndian ] )
- 25.3.4.9 DataView.prototype.getFloat64 ( byteOffset [ , littleEndian ] )
- 25.3.4.10 DataView.prototype.getInt8 ( byteOffset )
- 25.3.4.11 DataView.prototype.getInt16 ( byteOffset [ , littleEndian ] )
- 25.3.4.12 DataView.prototype.getInt32 ( byteOffset [ , littleEndian ] )
- 25.3.4.13 DataView.prototype.getUint8 ( byteOffset )
- 25.3.4.14 DataView.prototype.getUint16 ( byteOffset [ , littleEndian ] )
- 25.3.4.15 DataView.prototype.getUint32 ( byteOffset [ , littleEndian ] )
- 25.3.4.16 DataView.prototype.setBigInt64 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.17 DataView.prototype.setBigUint64 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.18 DataView.prototype.setFloat16 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.19 DataView.prototype.setFloat32 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.20 DataView.prototype.setFloat64 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.21 DataView.prototype.setInt8 ( byteOffset, value )
- 25.3.4.22 DataView.prototype.setInt16 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.23 DataView.prototype.setInt32 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.24 DataView.prototype.setUint8 ( byteOffset, value )
- 25.3.4.25 DataView.prototype.setUint16 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.26 DataView.prototype.setUint32 ( byteOffset, value [ , littleEndian ] )
- 25.3.4.27 DataView.prototype [ %Symbol.toStringTag% ]
- 25.3.5 Properties of DataView Instances
- +25.3.1 Abstract Operations For DataView Objects
- +25.4 The Atomics Object
- 25.4.1 Waiter Record
- 25.4.2 WaiterList Records
- +25.4.3 Abstract Operations for Atomics
- 25.4.3.1 ValidateIntegerTypedArray ( typedArray, waitable )
- 25.4.3.2 ValidateAtomicAccess ( taRecord, requestIndex )
- 25.4.3.3 ValidateAtomicAccessOnIntegerTypedArray ( typedArray, requestIndex )
- 25.4.3.4 RevalidateAtomicAccess ( typedArray, byteIndexInBuffer )
- 25.4.3.5 GetWaiterList ( block, i )
- 25.4.3.6 EnterCriticalSection ( WL )
- 25.4.3.7 LeaveCriticalSection ( WL )
- 25.4.3.8 AddWaiter ( WL, waiterRecord )
- 25.4.3.9 RemoveWaiter ( WL, waiterRecord )
- 25.4.3.10 RemoveWaiters ( WL, c )
- 25.4.3.11 SuspendThisAgent ( WL, waiterRecord )
- 25.4.3.12 NotifyWaiter ( WL, waiterRecord )
- 25.4.3.13 EnqueueResolveInAgentJob ( agentSignifier, promiseCapability, resolution )
- 25.4.3.14 DoWait ( mode, typedArray, index, value, timeout )
- 25.4.3.15 EnqueueAtomicsWaitAsyncTimeoutJob ( WL, waiterRecord )
- 25.4.3.16 AtomicCompareExchangeInSharedBlock ( block, byteIndexInBuffer, elementSize, expectedBytes, replacementBytes )
- 25.4.3.17 AtomicReadModifyWrite ( typedArray, index, value, op )
- 25.4.3.18 ByteListBitwiseOp ( op, xBytes, yBytes )
- 25.4.3.19 ByteListEqual ( xBytes, yBytes )
- 25.4.4 Atomics.add ( typedArray, index, value )
- 25.4.5 Atomics.and ( typedArray, index, value )
- 25.4.6 Atomics.compareExchange ( typedArray, index, expectedValue, replacementValue )
- 25.4.7 Atomics.exchange ( typedArray, index, value )
- 25.4.8 Atomics.isLockFree ( size )
- 25.4.9 Atomics.load ( typedArray, index )
- 25.4.10 Atomics.or ( typedArray, index, value )
- 25.4.11 Atomics.store ( typedArray, index, value )
- 25.4.12 Atomics.sub ( typedArray, index, value )
- 25.4.13 Atomics.wait ( typedArray, index, value, timeout )
- 25.4.14 Atomics.waitAsync ( typedArray, index, value, timeout )
- 25.4.15 Atomics.notify ( typedArray, index, count )
- 25.4.16 Atomics.xor ( typedArray, index, value )
- 25.4.17 Atomics [ %Symbol.toStringTag% ]
- +25.5 The JSON Object
- +25.1 ArrayBuffer Objects
- +26 Managing Memory
- +26.1 WeakRef Objects
- +26.2 FinalizationRegistry Objects
- +27 Control Abstraction Objects
- +27.1 Iteration
- +27.1.1 Common Iteration Interfaces
- +27.1.2 Iterator Helper Objects
- +27.1.3 Iterator Objects
- +27.1.4 Properties of the Iterator Prototype Object
- +27.1.4.1 Iterator.prototype.constructor
- 27.1.4.2 Iterator.prototype.drop ( limit )
- 27.1.4.3 Iterator.prototype.every ( predicate )
- 27.1.4.4 Iterator.prototype.filter ( predicate )
- 27.1.4.5 Iterator.prototype.find ( predicate )
- 27.1.4.6 Iterator.prototype.flatMap ( mapper )
- 27.1.4.7 Iterator.prototype.forEach ( procedure )
- 27.1.4.8 Iterator.prototype.map ( mapper )
- 27.1.4.9 Iterator.prototype.reduce ( reducer [ , initialValue ] )
- 27.1.4.10 Iterator.prototype.some ( predicate )
- 27.1.4.11 Iterator.prototype.take ( limit )
- 27.1.4.12 Iterator.prototype.toArray ( )
- 27.1.4.13 Iterator.prototype [ %Symbol.iterator% ] ( )
- +27.1.4.14 Iterator.prototype [ %Symbol.toStringTag% ]
- +27.1.5 The %AsyncIteratorPrototype% Object
- +27.1.6 Async-from-Sync Iterator Objects
- +27.2 Promise Objects
- +27.2.1 Promise Abstract Operations
- +27.2.1.1 PromiseCapability Records
- 27.2.1.2 PromiseReaction Records
- +27.2.1.3 CreateResolvingFunctions ( promise )
- 27.2.1.4 FulfillPromise ( promise, value )
- 27.2.1.5 NewPromiseCapability ( C )
- 27.2.1.6 IsPromise ( x )
- 27.2.1.7 RejectPromise ( promise, reason )
- 27.2.1.8 TriggerPromiseReactions ( reactions, argument )
- 27.2.1.9 HostPromiseRejectionTracker ( promise, operation )
- +27.2.2 Promise Jobs
- +27.2.3 The Promise Constructor
- +27.2.4 Properties of the Promise Constructor
- +27.2.4.1 Promise.all ( iterable )
- +27.2.4.2 Promise.allSettled ( iterable )
- +27.2.4.3 Promise.any ( iterable )
- 27.2.4.4 Promise.prototype
- +27.2.4.5 Promise.race ( iterable )
- 27.2.4.6 Promise.reject ( r )
- +27.2.4.7 Promise.resolve ( x )
- 27.2.4.8 Promise.try ( callback, ...args )
- 27.2.4.9 Promise.withResolvers ( )
- 27.2.4.10 get Promise [ %Symbol.species% ]
- +27.2.5 Properties of the Promise Prototype Object
- 27.2.6 Properties of Promise Instances
- +27.2.1 Promise Abstract Operations
- +27.3 GeneratorFunction Objects
- +27.4 AsyncGeneratorFunction Objects
- +27.5 Generator Objects
- +27.5.1 The %GeneratorPrototype% Object
- 27.5.2 Properties of Generator Instances
- +27.5.3 Generator Abstract Operations
- 27.5.3.1 GeneratorStart ( generator, generatorBody )
- 27.5.3.2 GeneratorValidate ( generator, generatorBrand )
- 27.5.3.3 GeneratorResume ( generator, value, generatorBrand )
- 27.5.3.4 GeneratorResumeAbrupt ( generator, abruptCompletion, generatorBrand )
- 27.5.3.5 GetGeneratorKind ( )
- 27.5.3.6 GeneratorYield ( iteratorResult )
- 27.5.3.7 Yield ( value )
- 27.5.3.8 CreateIteratorFromClosure ( closure, generatorBrand, generatorPrototype [ , extraSlots ] )
- +27.6 AsyncGenerator Objects
- +27.6.1 The %AsyncGeneratorPrototype% Object
- 27.6.2 Properties of AsyncGenerator Instances
- +27.6.3 AsyncGenerator Abstract Operations
- 27.6.3.1 AsyncGeneratorRequest Records
- 27.6.3.2 AsyncGeneratorStart ( generator, generatorBody )
- 27.6.3.3 AsyncGeneratorValidate ( generator, generatorBrand )
- 27.6.3.4 AsyncGeneratorEnqueue ( generator, completion, promiseCapability )
- 27.6.3.5 AsyncGeneratorCompleteStep ( generator, completion, done [ , realm ] )
- 27.6.3.6 AsyncGeneratorResume ( generator, completion )
- 27.6.3.7 AsyncGeneratorUnwrapYieldResumption ( resumptionValue )
- 27.6.3.8 AsyncGeneratorYield ( value )
- 27.6.3.9 AsyncGeneratorAwaitReturn ( generator )
- 27.6.3.10 AsyncGeneratorDrainQueue ( generator )
- 27.6.3.11 CreateAsyncIteratorFromClosure ( closure, generatorBrand, generatorPrototype )
- +27.7 AsyncFunction Objects
- +27.1 Iteration
- +28 Reflection
- +28.1 The Reflect Object
- 28.1.1 Reflect.apply ( target, thisArgument, argumentsList )
- 28.1.2 Reflect.construct ( target, argumentsList [ , newTarget ] )
- 28.1.3 Reflect.defineProperty ( target, propertyKey, attributes )
- 28.1.4 Reflect.deleteProperty ( target, propertyKey )
- 28.1.5 Reflect.get ( target, propertyKey [ , receiver ] )
- 28.1.6 Reflect.getOwnPropertyDescriptor ( target, propertyKey )
- 28.1.7 Reflect.getPrototypeOf ( target )
- 28.1.8 Reflect.has ( target, propertyKey )
- 28.1.9 Reflect.isExtensible ( target )
- 28.1.10 Reflect.ownKeys ( target )
- 28.1.11 Reflect.preventExtensions ( target )
- 28.1.12 Reflect.set ( target, propertyKey, V [ , receiver ] )
- 28.1.13 Reflect.setPrototypeOf ( target, proto )
- 28.1.14 Reflect [ %Symbol.toStringTag% ]
- +28.2 Proxy Objects
- +28.3 Module Namespace Objects
- +28.1 The Reflect Object
- +29 Memory Model
- 29.1 Memory Model Fundamentals
- 29.2 Agent Events Records
- 29.3 Chosen Value Records
- 29.4 Candidate Executions
- +29.5 Abstract Operations for the Memory Model
- +29.6 Relations of Candidate Executions
- +29.7 Properties of Valid Executions
- 29.8 Races
- 29.9 Data Races
- 29.10 Data Race Freedom
- 29.11 Shared Memory Guidelines
- +Annex A (informative) Grammar Summary
- +Annex B (normative) Additional ECMAScript Features for Web Browsers
- +B.1 Additional Syntax
- B.1.1 HTML-like Comments
- +B.1.2 Regular Expressions Patterns
- B.1.2.1 SS: Early Errors
- B.1.2.2 SS: CountLeftCapturingParensWithin and CountLeftCapturingParensBefore
- B.1.2.3 SS: IsCharacterClass
- B.1.2.4 SS: CharacterValue
- B.1.2.5 RS: CompileSubpattern
- B.1.2.6 RS: CompileAssertion
- B.1.2.7 RS: CompileAtom
- +B.1.2.8 RS: CompileToCharSet
- B.1.2.9 SS: ParsePattern ( patternText, u, v )
- +B.2 Additional Built-in Properties
- +B.2.1 Additional Properties of the Global Object
- +B.2.2 Additional Properties of the String.prototype Object
- B.2.2.1 String.prototype.substr ( start, length )
- +B.2.2.2 String.prototype.anchor ( name )
- B.2.2.3 String.prototype.big ( )
- B.2.2.4 String.prototype.blink ( )
- B.2.2.5 String.prototype.bold ( )
- B.2.2.6 String.prototype.fixed ( )
- B.2.2.7 String.prototype.fontcolor ( colour )
- B.2.2.8 String.prototype.fontsize ( size )
- B.2.2.9 String.prototype.italics ( )
- B.2.2.10 String.prototype.link ( url )
- B.2.2.11 String.prototype.small ( )
- B.2.2.12 String.prototype.strike ( )
- B.2.2.13 String.prototype.sub ( )
- B.2.2.14 String.prototype.sup ( )
- B.2.2.15 String.prototype.trimLeft ( )
- B.2.2.16 String.prototype.trimRight ( )
- +B.2.3 Additional Properties of the Date.prototype Object
- +B.2.4 Additional Properties of the RegExp.prototype Object
- +B.3 Other Additional Features
- B.3.1 Labelled Function Declarations
- +B.3.2 Block-Level Function Declarations Web Legacy Compatibility Semantics
- B.3.3 FunctionDeclarations in IfStatement Statement Clauses
- B.3.4 VariableStatements in Catch Blocks
- B.3.5 Initializers in ForIn Statement Heads
- +B.3.6 The [[IsHTMLDDA]] Internal Slot
- B.3.7 Non-default behaviour in HostMakeJobCallback
- B.3.8 Non-default behaviour in HostEnsureCanAddPrivateElement
- B.3.9 Runtime Errors for Function Call Assignment Targets
- +B.1 Additional Syntax
- Annex C (informative) The Strict Mode of ECMAScript
- +Annex D (informative) Host Layering Points
- Annex E (informative) Corrections and Clarifications in ECMAScript 2015 with Possible Compatibility Impact
- Annex F (informative) Additions and Changes That Introduce Incompatibilities with Prior Editions
- Bibliography
- Colophon
- Copyright & Software License
- Toggle shortcuts help
?
- Toggle "can call user code" annotations
u
- Navigate to/from multipage
m
- Jump to search box
/
- Toggle pinning of the current clause
p
- Jump to the nth pin
1-9
- Jump to the 10th pin
0
- Jump to the most recent link target
`
9 Executable Code and Execution Contexts
9.1 Environment Records
Environment Record is a specification type used to define the association of
Every Environment Record has an [[OuterEnv]] field, which is either
Environment Records are purely specification mechanisms and need not correspond to any specific artefact of an ECMAScript implementation. It is impossible for an ECMAScript program to directly access or manipulate such values.
9.1.1 The Environment Record Type Hierarchy
-
Environment Record (abstract)-
A
Declarative Environment Record is used to define the effect of ECMAScript language syntactic elements such asFunctionDeclaration s,VariableDeclaration s, andCatch clauses that directly associate identifier bindings withECMAScript language values .-
A
Function Environment Record corresponds to the invocation of an ECMAScriptfunction object , and contains bindings for the top-level declarations within that function. It may establish a newthis
binding. It also captures the state necessary to supportsuper
method invocations. -
A
Module Environment Record contains the bindings for the top-level declarations of aModule . It also contains the bindings that are explicitly imported by theModule . Its [[OuterEnv]] is aGlobal Environment Record .
-
-
An
Object Environment Record is used to define the effect of ECMAScript elements such asWithStatement that associate identifier bindings with the properties of some object. -
A
Global Environment Record is used forScript global declarations. It does not have an outer environment; its [[OuterEnv]] isnull . It may be prepopulated with identifier bindings and it includes an associatedglobal object whose properties provide some of the global environment's identifier bindings. As ECMAScript code is executed, additional properties may be added to theglobal object and the initial properties may be modified.
-
The
Method | Purpose |
---|---|
HasBinding(N) |
Determine if an |
CreateMutableBinding(N, D) |
Create a new but uninitialized mutable binding in an |
CreateImmutableBinding(N, S) |
Create a new but uninitialized immutable binding in an |
InitializeBinding(N, V) |
Set the value of an already existing but uninitialized binding in an |
SetMutableBinding(N, V, S) |
Set the value of an already existing mutable binding in an |
GetBindingValue(N, S) |
Returns the value of an already existing binding from an |
DeleteBinding(N) |
Delete a binding from an |
HasThisBinding() |
Determine if an this binding. Return |
HasSuperBinding() |
Determine if an super method binding. Return |
WithBaseObject() |
If this with statement, return the with object. Otherwise, return |
9.1.1.1 Declarative Environment Records
Each Declarative Environment Record is associated with an ECMAScript program scope containing variable, constant, let, class, module, import, and/or function declarations. A Declarative Environment Record binds the set of identifiers defined by the declarations contained within its scope.
9.1.1.1.1 HasBinding ( N )
The HasBinding concrete method of a
- If envRec has a binding for N, return
true . - Return
false .
9.1.1.1.2 CreateMutableBinding ( N, D )
The CreateMutableBinding concrete method of a
Assert : envRec does not already have a binding for N.- Create a mutable binding in envRec for N and record that it is uninitialized. If D is
true , record that the newly created binding may be deleted by a subsequent DeleteBinding call. - Return
unused .
9.1.1.1.3 CreateImmutableBinding ( N, S )
The CreateImmutableBinding concrete method of a
Assert : envRec does not already have a binding for N.- Create an immutable binding in envRec for N and record that it is uninitialized. If S is
true , record that the newly created binding is a strict binding. - Return
unused .
9.1.1.1.4 InitializeBinding ( N, V )
The InitializeBinding concrete method of a
Assert : envRec must have an uninitialized binding for N.- Set the bound value for N in envRec to V.
Record that the binding for N in envRec has been initialized.- Return
unused .
9.1.1.1.5 SetMutableBinding ( N, V, S )
The SetMutableBinding concrete method of a
- If envRec does not have a binding for N, then
- If S is
true , throw aReferenceError exception. - Perform ! envRec.CreateMutableBinding(N,
true ). - Perform ! envRec.InitializeBinding(N, V).
- Return
unused .
- If S is
- If the binding for N in envRec is a strict binding, set S to
true . - If the binding for N in envRec has not yet been initialized, then
- Throw a
ReferenceError exception.
- Throw a
- Else if the binding for N in envRec is a mutable binding, then
- Change its bound value to V.
- Else,
Assert : This is an attempt to change the value of an immutable binding.- If S is
true , throw aTypeError exception.
- Return
unused .
An example of ECMAScript code that results in a missing binding at step
function f() { eval("var x; x = (delete x, 0);"); }
9.1.1.1.6 GetBindingValue ( N, S )
The GetBindingValue concrete method of a
Assert : envRec has a binding for N.- If the binding for N in envRec is an uninitialized binding, throw a
ReferenceError exception. - Return the value currently bound to N in envRec.
9.1.1.1.7 DeleteBinding ( N )
The DeleteBinding concrete method of a
Assert : envRec has a binding for N.- If the binding for N in envRec cannot be deleted, return
false . - Remove the binding for N from envRec.
- Return
true .
9.1.1.1.8 HasThisBinding ( )
The HasThisBinding concrete method of a
- Return
false .
A regular this
binding.
9.1.1.1.9 HasSuperBinding ( )
The HasSuperBinding concrete method of a
- Return
false .
A regular super
binding.
9.1.1.1.10 WithBaseObject ( )
The WithBaseObject concrete method of a
- Return
undefined .
9.1.1.2 Object Environment Records
Each Object Environment Record is associated with an object called its binding object. An Object Environment Record binds the set of string identifier names that directly correspond to the property names of its binding object.
Object Environment Records created for with
statements (
Object Environment Records have the additional state fields listed in
Field Name | Value | Meaning |
---|---|---|
[[BindingObject]] | an Object |
The binding object of this |
[[IsWithEnvironment]] | a Boolean |
Indicates whether this with statement.
|
9.1.1.2.1 HasBinding ( N )
The HasBinding concrete method of an
- Let bindingObject be envRec.[[BindingObject]].
- Let foundBinding be ?
HasProperty (bindingObject, N). - If foundBinding is
false , returnfalse . - If envRec.[[IsWithEnvironment]] is
false , returntrue . - Let unscopables be ?
Get (bindingObject,%Symbol.unscopables% ). - If unscopables
is an Object , then - Return
true .
9.1.1.2.2 CreateMutableBinding ( N, D )
The CreateMutableBinding concrete method of an
- Let bindingObject be envRec.[[BindingObject]].
- Perform ?
DefinePropertyOrThrow (bindingObject, N, PropertyDescriptor { [[Value]]:undefined , [[Writable]]:true , [[Enumerable]]:true , [[Configurable]]: D }). - Return
unused .
Normally envRec will not have a binding for N but if it does, the semantics of
9.1.1.2.3 CreateImmutableBinding ( N, S )
The CreateImmutableBinding concrete method of an
9.1.1.2.4 InitializeBinding ( N, V )
The InitializeBinding concrete method of an
- Perform ? envRec.SetMutableBinding(N, V,
false ). - Return
unused .
In this specification, all uses of CreateMutableBinding for
9.1.1.2.5 SetMutableBinding ( N, V, S )
The SetMutableBinding concrete method of an
- Let bindingObject be envRec.[[BindingObject]].
- Let stillExists be ?
HasProperty (bindingObject, N). - If stillExists is
false and S istrue , throw aReferenceError exception. - Perform ?
Set (bindingObject, N, V, S). - Return
unused .
9.1.1.2.6 GetBindingValue ( N, S )
The GetBindingValue concrete method of an
- Let bindingObject be envRec.[[BindingObject]].
- Let value be ?
HasProperty (bindingObject, N). - If value is
false , then- If S is
false , returnundefined ; otherwise throw aReferenceError exception.
- If S is
- Return ?
Get (bindingObject, N).
9.1.1.2.7 DeleteBinding ( N )
The DeleteBinding concrete method of an
- Let bindingObject be envRec.[[BindingObject]].
- Return ? bindingObject.[[Delete]](N).
9.1.1.2.8 HasThisBinding ( )
The HasThisBinding concrete method of an
- Return
false .
this
binding.
9.1.1.2.9 HasSuperBinding ( )
The HasSuperBinding concrete method of an
- Return
false .
super
binding.
9.1.1.2.10 WithBaseObject ( )
The WithBaseObject concrete method of an
- If envRec.[[IsWithEnvironment]] is
true , return envRec.[[BindingObject]]. - Otherwise, return
undefined .
9.1.1.3 Function Environment Records
A Function Environment Record is a this
binding. If a function is not an super
, its Function Environment Record also contains the state that is used to perform super
method invocations from within the function.
Function Environment Records have the additional state fields listed in
Field Name | Value | Meaning |
---|---|---|
[[ThisValue]] |
an |
This is the |
[[ThisBindingStatus]] |
|
If the value is |
[[FunctionObject]] |
an ECMAScript |
The |
[[NewTarget]] |
a |
If this |
Function Environment Records support all of the
Method | Purpose |
---|---|
GetThisBinding() |
Return the value of this this binding. Throws a this binding has not been initialized.
|
9.1.1.3.1 BindThisValue ( envRec, V )
The abstract operation BindThisValue takes arguments envRec (a
Assert : envRec.[[ThisBindingStatus]] is notlexical .- If envRec.[[ThisBindingStatus]] is
initialized , throw aReferenceError exception. - Set envRec.[[ThisValue]] to V.
- Set envRec.[[ThisBindingStatus]] to
initialized . - Return
unused .
9.1.1.3.2 HasThisBinding ( )
The HasThisBinding concrete method of a
- If envRec.[[ThisBindingStatus]] is
lexical , returnfalse ; otherwise, returntrue .
9.1.1.3.3 HasSuperBinding ( )
The HasSuperBinding concrete method of a
- If envRec.[[ThisBindingStatus]] is
lexical , returnfalse . - If envRec.[[FunctionObject]].[[HomeObject]] is
undefined , returnfalse ; otherwise, returntrue .
9.1.1.3.4 GetThisBinding ( )
The GetThisBinding concrete method of a
Assert : envRec.[[ThisBindingStatus]] is notlexical .- If envRec.[[ThisBindingStatus]] is
uninitialized , throw aReferenceError exception. - Return envRec.[[ThisValue]].
9.1.1.3.5 GetSuperBase ( envRec )
The abstract operation GetSuperBase takes argument envRec (a super
property accesses bound in envRec. The value
- Let home be envRec.[[FunctionObject]].[[HomeObject]].
- If home is
undefined , returnundefined . Assert : home is anordinary object .- Return ! home.[[GetPrototypeOf]]().
9.1.1.4 Global Environment Records
A Global Environment Record is used to represent the outer most scope that is shared by all of the ECMAScript
A Global Environment Record is logically a single record but it is specified as a composite encapsulating an
Properties may be created directly on a
Global Environment Records have the additional fields listed in
Field Name | Value | Meaning |
---|---|---|
[[ObjectRecord]] |
an |
Binding object is the |
[[GlobalThisValue]] | an Object |
The value returned by this in global scope. |
[[DeclarativeRecord]] |
a |
|
Method | Purpose |
---|---|
GetThisBinding() |
Return the value of this this binding.
|
9.1.1.4.1 HasBinding ( N )
The HasBinding concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , returntrue . - Let ObjRec be envRec.[[ObjectRecord]].
- Return ? ObjRec.HasBinding(N).
9.1.1.4.2 CreateMutableBinding ( N, D )
The CreateMutableBinding concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , throw aTypeError exception. - Return ! DclRec.CreateMutableBinding(N, D).
9.1.1.4.3 CreateImmutableBinding ( N, S )
The CreateImmutableBinding concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , throw aTypeError exception. - Return ! DclRec.CreateImmutableBinding(N, S).
9.1.1.4.4 InitializeBinding ( N, V )
The InitializeBinding concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , then- Return ! DclRec.InitializeBinding(N, V).
Assert : If the binding exists, it must be in theObject Environment Record .- Let ObjRec be envRec.[[ObjectRecord]].
- Return ? ObjRec.InitializeBinding(N, V).
9.1.1.4.5 SetMutableBinding ( N, V, S )
The SetMutableBinding concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , then- Return ? DclRec.SetMutableBinding(N, V, S).
- Let ObjRec be envRec.[[ObjectRecord]].
- Return ? ObjRec.SetMutableBinding(N, V, S).
9.1.1.4.6 GetBindingValue ( N, S )
The GetBindingValue concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , then- Return ? DclRec.GetBindingValue(N, S).
- Let ObjRec be envRec.[[ObjectRecord]].
- Return ? ObjRec.GetBindingValue(N, S).
9.1.1.4.7 DeleteBinding ( N )
The DeleteBinding concrete method of a
- Let DclRec be envRec.[[DeclarativeRecord]].
- If ! DclRec.HasBinding(N) is
true , then- Return ! DclRec.DeleteBinding(N).
- Let ObjRec be envRec.[[ObjectRecord]].
- Let globalObject be ObjRec.[[BindingObject]].
- Let existingProp be ?
HasOwnProperty (globalObject, N). - If existingProp is
true , then- Return ? ObjRec.DeleteBinding(N).
- Return
true .
9.1.1.4.8 HasThisBinding ( )
The HasThisBinding concrete method of a
- Return
true .
this
binding.
9.1.1.4.9 HasSuperBinding ( )
The HasSuperBinding concrete method of a
- Return
false .
super
binding.
9.1.1.4.10 WithBaseObject ( )
The WithBaseObject concrete method of a
- Return
undefined .
9.1.1.4.11 GetThisBinding ( )
The GetThisBinding concrete method of a
- Return envRec.[[GlobalThisValue]].
9.1.1.4.12 HasLexicalDeclaration ( envRec, N )
The abstract operation HasLexicalDeclaration takes arguments envRec (a
- Let DclRec be envRec.[[DeclarativeRecord]].
- Return ! DclRec.HasBinding(N).
9.1.1.4.13 HasRestrictedGlobalProperty ( envRec, N )
The abstract operation HasRestrictedGlobalProperty takes arguments envRec (a
- Let ObjRec be envRec.[[ObjectRecord]].
- Let globalObject be ObjRec.[[BindingObject]].
- Let existingProp be ? globalObject.[[GetOwnProperty]](N).
- If existingProp is
undefined , returnfalse . - If existingProp.[[Configurable]] is
true , returnfalse . - Return
true .
Properties may exist upon a
9.1.1.4.14 CanDeclareGlobalVar ( envRec, N )
The abstract operation CanDeclareGlobalVar takes arguments envRec (a
- Let ObjRec be envRec.[[ObjectRecord]].
- Let globalObject be ObjRec.[[BindingObject]].
- Let hasProperty be ?
HasOwnProperty (globalObject, N). - If hasProperty is
true , returntrue . - Return ?
IsExtensible (globalObject).
9.1.1.4.15 CanDeclareGlobalFunction ( envRec, N )
The abstract operation CanDeclareGlobalFunction takes arguments envRec (a
- Let ObjRec be envRec.[[ObjectRecord]].
- Let globalObject be ObjRec.[[BindingObject]].
- Let existingProp be ? globalObject.[[GetOwnProperty]](N).
- If existingProp is
undefined , return ?IsExtensible (globalObject). - If existingProp.[[Configurable]] is
true , returntrue . - If
IsDataDescriptor (existingProp) istrue and existingProp has attribute values { [[Writable]]:true , [[Enumerable]]:true }, returntrue . - Return
false .
9.1.1.4.16 CreateGlobalVarBinding ( envRec, N, D )
The abstract operation CreateGlobalVarBinding takes arguments envRec (a
- Let ObjRec be envRec.[[ObjectRecord]].
- Let globalObject be ObjRec.[[BindingObject]].
- Let hasProperty be ?
HasOwnProperty (globalObject, N). - Let extensible be ?
IsExtensible (globalObject). - If hasProperty is
false and extensible istrue , then- Perform ? ObjRec.CreateMutableBinding(N, D).
- Perform ? ObjRec.InitializeBinding(N,
undefined ).
- Return
unused .
9.1.1.4.17 CreateGlobalFunctionBinding ( envRec, N, V, D )
The abstract operation CreateGlobalFunctionBinding takes arguments envRec (a
- Let ObjRec be envRec.[[ObjectRecord]].
- Let globalObject be ObjRec.[[BindingObject]].
- Let existingProp be ? globalObject.[[GetOwnProperty]](N).
- If existingProp is
undefined or existingProp.[[Configurable]] istrue , then- Let desc be the PropertyDescriptor { [[Value]]: V, [[Writable]]:
true , [[Enumerable]]:true , [[Configurable]]: D }.
- Let desc be the PropertyDescriptor { [[Value]]: V, [[Writable]]:
- Else,
- Let desc be the PropertyDescriptor { [[Value]]: V }.
- Perform ?
DefinePropertyOrThrow (globalObject, N, desc). - Perform ?
Set (globalObject, N, V,false ). - Return
unused .
Global function declarations are always represented as own properties of the
9.1.1.5 Module Environment Records
A Module Environment Record is a
Module Environment Records support all of the
Method | Purpose |
---|---|
GetThisBinding() |
Return the value of this this binding.
|
9.1.1.5.1 GetBindingValue ( N, S )
The GetBindingValue concrete method of a
Assert : S istrue .Assert : envRec has a binding for N.- If the binding for N is an indirect binding, then
- Let M and N2 be the indirection values provided when this binding for N was created.
- Let targetEnv be M.[[Environment]].
- If targetEnv is
empty , throw aReferenceError exception. - Return ? targetEnv.GetBindingValue(N2,
true ).
- If the binding for N in envRec is an uninitialized binding, throw a
ReferenceError exception. - Return the value currently bound to N in envRec.
S will always be
9.1.1.5.2 DeleteBinding ( N )
The DeleteBinding concrete method of a
9.1.1.5.3 HasThisBinding ( )
The HasThisBinding concrete method of a
- Return
true .
this
binding.
9.1.1.5.4 GetThisBinding ( )
The GetThisBinding concrete method of a
- Return
undefined .
9.1.1.5.5 CreateImportBinding ( envRec, N, M, N2 )
The abstract operation CreateImportBinding takes arguments envRec (a
9.1.2 Environment Record Operations
The following
9.1.2.1 GetIdentifierReference ( env, name, strict )
The abstract operation GetIdentifierReference takes arguments env (an
- If env is
null , then- Return the
Reference Record { [[Base]]:unresolvable , [[ReferencedName]]: name, [[Strict]]: strict, [[ThisValue]]:empty }.
- Return the
- Let exists be ? env.HasBinding(name).
- If exists is
true , then- Return the
Reference Record { [[Base]]: env, [[ReferencedName]]: name, [[Strict]]: strict, [[ThisValue]]:empty }.
- Return the
- Else,
- Let outer be env.[[OuterEnv]].
- Return ?
GetIdentifierReference (outer, name, strict).
9.1.2.2 NewDeclarativeEnvironment ( E )
The abstract operation NewDeclarativeEnvironment takes argument E (an
- Let env be a new
Declarative Environment Record containing no bindings. - Set env.[[OuterEnv]] to E.
- Return env.
9.1.2.3 NewObjectEnvironment ( O, W, E )
The abstract operation NewObjectEnvironment takes arguments O (an Object), W (a Boolean), and E (an
- Let env be a new
Object Environment Record . - Set env.[[BindingObject]] to O.
- Set env.[[IsWithEnvironment]] to W.
- Set env.[[OuterEnv]] to E.
- Return env.
9.1.2.4 NewFunctionEnvironment ( F, newTarget )
The abstract operation NewFunctionEnvironment takes arguments F (an ECMAScript
- Let env be a new
Function Environment Record containing no bindings. - Set env.[[FunctionObject]] to F.
- If F.[[ThisMode]] is
lexical , set env.[[ThisBindingStatus]] tolexical . - Else, set env.[[ThisBindingStatus]] to
uninitialized . - Set env.[[NewTarget]] to newTarget.
- Set env.[[OuterEnv]] to F.[[Environment]].
- Return env.
9.1.2.5 NewGlobalEnvironment ( G, thisValue )
The abstract operation NewGlobalEnvironment takes arguments G (an Object) and thisValue (an Object) and returns a
- Let objRec be
NewObjectEnvironment (G,false ,null ). - Let dclRec be
NewDeclarativeEnvironment (null ). - Let env be a new
Global Environment Record . - Set env.[[ObjectRecord]] to objRec.
- Set env.[[GlobalThisValue]] to thisValue.
- Set env.[[DeclarativeRecord]] to dclRec.
- Set env.[[OuterEnv]] to
null . - Return env.
9.1.2.6 NewModuleEnvironment ( E )
The abstract operation NewModuleEnvironment takes argument E (an
- Let env be a new
Module Environment Record containing no bindings. - Set env.[[OuterEnv]] to E.
- Return env.
9.2 PrivateEnvironment Records
A PrivateEnvironment Record is a specification mechanism used to track
Each
Field Name | Value Type | Meaning |
---|---|---|
[[OuterPrivateEnvironment]] |
a |
The |
[[Names]] |
a |
The |
9.2.1 PrivateEnvironment Record Operations
The following
9.2.1.1 NewPrivateEnvironment ( outerPrivateEnv )
The abstract operation NewPrivateEnvironment takes argument outerPrivateEnv (a
- Let names be a new empty
List . - Return the
PrivateEnvironment Record { [[OuterPrivateEnvironment]]: outerPrivateEnv, [[Names]]: names }.
9.2.1.2 ResolvePrivateIdentifier ( privateEnv, identifier )
The abstract operation ResolvePrivateIdentifier takes arguments privateEnv (a
- Let names be privateEnv.[[Names]].
- For each
Private Name pn of names, do- If pn.[[Description]] is identifier, then
- Return pn.
- If pn.[[Description]] is identifier, then
- Let outerPrivateEnv be privateEnv.[[OuterPrivateEnvironment]].
Assert : outerPrivateEnv is notnull .- Return
ResolvePrivateIdentifier (outerPrivateEnv, identifier).
9.3 Realms
Before it is evaluated, all ECMAScript code must be associated with a realm. Conceptually, a
A
Field Name | Value | Meaning |
---|---|---|
[[AgentSignifier]] |
an |
The |
[[Intrinsics]] |
a |
The intrinsic values used by code associated with this |
[[GlobalObject]] | an Object |
The |
[[GlobalEnv]] |
a |
The global environment for this |
[[TemplateMap]] |
a |
Template objects are canonicalized separately for each Once a |
[[LoadedModules]] |
a |
A map from the specifier strings imported by this
As mentioned in import() expression in a context where there is no |
[[HostDefined]] |
anything (default value is |
Field reserved for use by |
9.3.1 InitializeHostDefinedRealm ( )
The abstract operation InitializeHostDefinedRealm takes no arguments and returns either a
- Let realm be a new
Realm Record . - Perform
CreateIntrinsics (realm). - Set realm.[[AgentSignifier]] to
AgentSignifier (). - Set realm.[[TemplateMap]] to a new empty
List . - Let newContext be a new
execution context . - Set the Function of newContext to
null . - Set the
Realm of newContext to realm. - Set the ScriptOrModule of newContext to
null . - Push newContext onto the
execution context stack ; newContext is now therunning execution context . - If the
host requires use of anexotic object to serve as realm'sglobal object , then- Let global be such an object created in a
host-defined manner.
- Let global be such an object created in a
- Else,
- Let global be
OrdinaryObjectCreate (realm.[[Intrinsics]].[[%Object.prototype% ]]).
- Let global be
- If the
host requires that thethis
binding in realm's global scope return an object other than theglobal object , then- Let thisValue be such an object created in a
host-defined manner.
- Let thisValue be such an object created in a
- Else,
- Let thisValue be global.
- Set realm.[[GlobalObject]] to global.
- Set realm.[[GlobalEnv]] to
NewGlobalEnvironment (global, thisValue). - Perform ?
SetDefaultGlobalBindings (realm). - Create any
host-defined global object properties on global. - Return
unused .
9.3.2 CreateIntrinsics ( realmRec )
The abstract operation CreateIntrinsics takes argument realmRec (a
- Set realmRec.[[Intrinsics]] to a new
Record . - Set fields of realmRec.[[Intrinsics]] with the values listed in
Table 6 . The field names are the names listed in column one of the table. The value of each field is a new object value fully and recursively populated with property values as defined by the specification of each object in clauses19 through28 . All object property values are newly created object values. All values that are built-infunction objects are created by performingCreateBuiltinFunction (steps, length, name, slots, realmRec, prototype) where steps is the definition of that function provided by this specification, name is the initial value of the function's"name" property, length is the initial value of the function's"length" property, slots is a list of the names, if any, of the function's specified internal slots, and prototype is the specified value of the function's [[Prototype]] internal slot. The creation of the intrinsics and their properties must be ordered to avoid any dependencies upon objects that have not yet been created. - Perform
AddRestrictedFunctionProperties (realmRec.[[Intrinsics]].[[%Function.prototype% ]], realmRec). - Return
unused .
9.3.3 SetDefaultGlobalBindings ( realmRec )
The abstract operation SetDefaultGlobalBindings takes argument realmRec (a
- Let global be realmRec.[[GlobalObject]].
- For each property of the Global Object specified in clause
19 , do- Let name be the String value of the
property name . - Let desc be the fully populated data
Property Descriptor for the property, containing the specified attributes for the property. For properties listed in19.2 ,19.3 , or19.4 the value of the [[Value]] attribute is the corresponding intrinsic object from realmRec. - Perform ?
DefinePropertyOrThrow (global, name, desc).
- Let name be the String value of the
- Return
unused .
9.4 Execution Contexts
An execution context is a specification device that is used to track the runtime evaluation of code by an ECMAScript implementation. At any point in time, there is at most one execution context per
The execution context stack is used to track execution contexts. The
An execution context contains whatever implementation specific state is necessary to track the execution progress of its associated code. Each execution context has at least the state components listed in
Component | Purpose |
---|---|
code evaluation state |
Any state needed to perform, suspend, and resume evaluation of the code associated with this |
Function |
If this |
|
The |
ScriptOrModule |
The |
The value of the
ECMAScript code execution contexts have the additional state components listed in
Component | Purpose |
---|---|
LexicalEnvironment |
Identifies the |
VariableEnvironment |
Identifies the |
PrivateEnvironment |
Identifies the |
The LexicalEnvironment and VariableEnvironment components of an execution context are always
Execution contexts representing the evaluation of Generators have the additional state components listed in
Component | Purpose |
---|---|
Generator |
The Generator that this |
In most situations only the
An execution context is purely a specification mechanism and need not correspond to any particular artefact of an ECMAScript implementation. It is impossible for ECMAScript code to directly access or observe an execution context.
9.4.1 GetActiveScriptOrModule ( )
The abstract operation GetActiveScriptOrModule takes no arguments and returns a
- If the
execution context stack is empty, returnnull . - Let ec be the topmost
execution context on theexecution context stack whose ScriptOrModule component is notnull . - If no such
execution context exists, returnnull . Otherwise, return ec's ScriptOrModule.
9.4.2 ResolveBinding ( name [ , env ] )
The abstract operation ResolveBinding takes argument name (a String) and optional argument env (an
- If env is not present or env is
undefined , then- Set env to the
running execution context 's LexicalEnvironment.
- Set env to the
Assert : env is anEnvironment Record .- Let strict be
IsStrict (the syntactic production that is being evaluated). - Return ?
GetIdentifierReference (env, name, strict).
The result of ResolveBinding is always a
9.4.3 GetThisEnvironment ( )
The abstract operation GetThisEnvironment takes no arguments and returns an this
. It performs the following steps when called:
- Let env be the
running execution context 's LexicalEnvironment. - Repeat,
- Let exists be env.HasThisBinding().
- If exists is
true , return env. - Let outer be env.[[OuterEnv]].
Assert : outer is notnull .- Set env to outer.
The loop in step this
binding.
9.4.4 ResolveThisBinding ( )
The abstract operation ResolveThisBinding takes no arguments and returns either a this
using the LexicalEnvironment of the
- Let envRec be
GetThisEnvironment (). - Return ? envRec.GetThisBinding().
9.4.5 GetNewTarget ( )
The abstract operation GetNewTarget takes no arguments and returns an Object or
- Let envRec be
GetThisEnvironment (). Assert : envRec has a [[NewTarget]] field.- Return envRec.[[NewTarget]].
9.4.6 GetGlobalObject ( )
The abstract operation GetGlobalObject takes no arguments and returns an Object. It returns the
- Let currentRealm be
the current Realm Record . - Return currentRealm.[[GlobalObject]].
9.5 Jobs and Host Operations to Enqueue Jobs
A Job is an
- At some future point in time, when there is no running context in the
agent for which the job is scheduled and thatagent 'sexecution context stack is empty, the implementation must:- Perform any
host-defined preparation steps. Invoke theJob Abstract Closure .- Perform any
host-defined cleanup steps, after which theexecution context stack must be empty.
- Perform any
- Only one
Job may be actively undergoing evaluation at any point in time in anagent . - Once evaluation of a
Job starts, it must run to completion before evaluation of any otherJob starts in anagent . - The
Abstract Closure must return anormal completion , implementing its own handling of errors.
At any particular time, scriptOrModule (a
GetActiveScriptOrModule () is scriptOrModule.- If scriptOrModule is a
Script Record orModule Record , let ec be the topmostexecution context on theexecution context stack whose ScriptOrModule component is scriptOrModule. TheRealm component of ec is scriptOrModule.[[Realm]].
At any particular time, an execution is prepared to evaluate ECMAScript code if all of the following conditions are true:
- The
execution context stack is not empty. - The
Realm component of the topmostexecution context on theexecution context stack is aRealm Record .
The specific choice of
Particular kinds of
9.5.1 JobCallback Records
A JobCallback Record is a
The WHATWG HTML specification (https://html.spec.whatwg.org/), for example, uses the
JobCallback Records have the fields listed in
Field Name | Value | Meaning |
---|---|---|
[[Callback]] |
a |
The function to invoke when the |
[[HostDefined]] |
anything (default value is |
Field reserved for use by |
9.5.2 HostMakeJobCallback ( callback )
The
An implementation of HostMakeJobCallback must conform to the following requirements:
- It must return a
JobCallback Record whose [[Callback]] field is callback.
The default implementation of HostMakeJobCallback performs the following steps when called:
- Return the
JobCallback Record { [[Callback]]: callback, [[HostDefined]]:empty }.
ECMAScript
This is called at the time that the callback is passed to the function that is responsible for its being eventually scheduled and run. For example, promise.then(thenAction)
calls MakeJobCallback on thenAction
at the time of invoking Promise.prototype.then
, not at the time of scheduling the reaction
9.5.3 HostCallJobCallback ( jobCallback, V, argumentsList )
The
An implementation of HostCallJobCallback must conform to the following requirements:
- It must perform and return the result of
Call (jobCallback.[[Callback]], V, argumentsList).
This requirement means that
The default implementation of HostCallJobCallback performs the following steps when called:
Assert :IsCallable (jobCallback.[[Callback]]) istrue .- Return ?
Call (jobCallback.[[Callback]], V, argumentsList).
ECMAScript
9.5.4 HostEnqueueGenericJob ( job, realm )
The
An implementation of HostEnqueueGenericJob must conform to the requirements in
9.5.5 HostEnqueuePromiseJob ( job, realm )
The
An implementation of HostEnqueuePromiseJob must conform to the requirements in
- If realm is not
null , each time job is invoked the implementation must performimplementation-defined steps such that execution isprepared to evaluate ECMAScript code at the time of job's invocation. - Let scriptOrModule be
GetActiveScriptOrModule () at the time HostEnqueuePromiseJob is invoked. If realm is notnull , each time job is invoked the implementation must performimplementation-defined steps such that scriptOrModule is theactive script or module at the time of job's invocation. Jobs must run in the same order as the HostEnqueuePromiseJob invocations that scheduled them.
The realm for
9.5.6 HostEnqueueTimeoutJob ( timeoutJob, realm, milliseconds )
The
An implementation of HostEnqueueTimeoutJob must conform to the requirements in
9.6 Agents
An agent comprises a set of ECMAScript
An
Some web browsers share a single
While an
An agent signifier is a globally-unique opaque value used to identify an
Field Name | Value | Meaning |
---|---|---|
[[LittleEndian]] | a Boolean | The default value computed for the isLittleEndian parameter when it is needed by the algorithms |
[[CanBlock]] | a Boolean | Determines whether the |
[[Signifier]] | an |
Uniquely identifies the |
[[IsLockFree1]] | a Boolean | |
[[IsLockFree2]] | a Boolean | |
[[IsLockFree8]] | a Boolean | |
[[CandidateExecution]] | a |
See the |
[[KeptAlive]] | a |
Initially a new empty |
[[ModuleAsyncEvaluationCount]] | an |
Initially 0, used to assign unique incrementing values to the [[AsyncEvaluationOrder]] field of modules that are asynchronous or have asynchronous dependencies. |
Once the values of [[Signifier]], [[IsLockFree1]], and [[IsLockFree2]] have been observed by any
The values of [[IsLockFree1]] and [[IsLockFree2]] are not necessarily determined by the hardware, but may also reflect implementation choices that can vary over time and between ECMAScript implementations.
There is no [[IsLockFree4]] field: 4-byte atomic operations are always lock-free.
In practice, if an atomic operation is implemented with any type of lock the operation is not lock-free. Lock-free does not imply wait-free: there is no upper bound on how many machine steps may be required to complete a lock-free atomic operation.
That an atomic access of size n is lock-free does not imply anything about the (perceived) atomicity of non-atomic accesses of size n, specifically, non-atomic accesses may still be performed as a sequence of several separate memory accesses. See
An
9.6.1 AgentSignifier ( )
The abstract operation AgentSignifier takes no arguments and returns an
- Let AR be the
Agent Record of thesurrounding agent . - Return AR.[[Signifier]].
9.6.2 AgentCanSuspend ( )
The abstract operation AgentCanSuspend takes no arguments and returns a Boolean. It performs the following steps when called:
- Let AR be the
Agent Record of thesurrounding agent . - Return AR.[[CanBlock]].
In some environments it may not be reasonable for a given
9.6.3 IncrementModuleAsyncEvaluationCount ( )
The abstract operation IncrementModuleAsyncEvaluationCount takes no arguments and returns an
- Let AR be the
Agent Record of thesurrounding agent . - Let count be AR.[[ModuleAsyncEvaluationCount]].
- Set AR.[[ModuleAsyncEvaluationCount]] to count + 1.
- Return count.
This value is only used to keep track of the relative evaluation order between pending modules. An implementation may unobservably reset [[ModuleAsyncEvaluationCount]] to 0 whenever there are no pending modules.
9.7 Agent Clusters
An agent cluster is a maximal set of
Programs within different
There may be
Every
All
If different
All
All
An embedding may deactivate (stop forward progress) or activate (resume forward progress) an
The purpose of the preceding restriction is to avoid a situation where an
The implication of the restriction is that it will not be possible to share memory between
An embedding may terminate an
Each of the following specification values, and values transitively reachable from them, belong to exactly one agent cluster.
Prior to any evaluation of any ECMAScript code by any
All
An agent cluster is a specification mechanism and need not correspond to any particular artefact of an ECMAScript implementation.
9.8 Forward Progress
For an
An
Implementations must ensure that:
- every unblocked
agent with a dedicatedexecuting thread eventually makes forward progress - in a set of
agents that share anexecuting thread , oneagent eventually makes forward progress - an
agent does not cause anotheragent to become blocked except via explicit APIs that provide blocking.
This, along with the liveness guarantee in the
9.9 Processing Model of WeakRef and FinalizationRegistry Targets
9.9.1 Objectives
This specification does not make any guarantees that any object or symbol will be garbage collected. Objects or symbols which are not
The semantics of
-
When
WeakRef.prototype.deref
is called, the referent (ifundefined is not returned) is kept alive so that subsequent, synchronous accesses also return the same value. This list is reset when synchronous work is done using theClearKeptObjects abstract operation. -
When an object or symbol which is registered with a
FinalizationRegistry becomes unreachable, a call of theFinalizationRegistry 's cleanup callback may eventually be made, after synchronous ECMAScript execution completes. TheFinalizationRegistry cleanup is performed with theCleanupFinalizationRegistry abstract operation.
Neither of these actions (
Some ECMAScript implementations include garbage collector implementations which run in the background, including when ECMAScript is idle. Letting the
9.9.2 Liveness
For some set of objects and/or symbols S a hypothetical WeakRef-oblivious execution with respect to S is an execution whereby the abstract operation
At any point during evaluation, a set of objects and/or symbols S is considered live if either of the following conditions is met:
-
Any element in S is included in any
agent 's [[KeptAlive]]List . - There exists a valid future hypothetical WeakRef-oblivious execution with respect to S that observes the identity of any value in S.
Presence of an object or a symbol in a field, an internal slot, or a property does not imply that the value is live. For example if the value in question is never passed back to the program, then it cannot be observed.
This is the case for keys in a WeakMap, members of a WeakSet, as well as the [[WeakRefTarget]] and [[UnregisterToken]] fields of a
The above definition implies that, if a key in a WeakMap is not live, then its corresponding value is not necessarily live either.
9.9.3 Execution
At any time, if a set of objects and/or symbols S is not
- For each element value of S, do
- For each
WeakRef ref such that ref.[[WeakRefTarget]] is value, do- Set ref.[[WeakRefTarget]] to
empty .
- Set ref.[[WeakRefTarget]] to
- For each
FinalizationRegistry fg such that fg.[[Cells]] contains aRecord cell such that cell.[[WeakRefTarget]] is value, do- Set cell.[[WeakRefTarget]] to
empty . - Optionally, perform
HostEnqueueFinalizationRegistryCleanupJob (fg).
- Set cell.[[WeakRefTarget]] to
- For each WeakMap map such that map.[[WeakMapData]] contains a
Record r such that r.[[Key]] is value, do- Set r.[[Key]] to
empty . - Set r.[[Value]] to
empty .
- Set r.[[Key]] to
- For each WeakSet set such that set.[[WeakSetData]] contains value, do
- Replace the element of set.[[WeakSetData]] whose value is value with an element whose value is
empty .
- Replace the element of set.[[WeakSetData]] whose value is value with an element whose value is
- For each
Together with the definition of liveness, this clause prescribes optimizations that an implementation may apply regarding
It is possible to access an object without observing its identity. Optimizations such as dead variable elimination and scalar replacement on properties of non-escaping objects whose identity is not observed are allowed. These optimizations are thus allowed to observably empty
On the other hand, if an object's identity is observable, and that object is in the [[WeakRefTarget]] internal slot of a
Because calling
Implementations are not obligated to empty
If an implementation chooses a non-
9.9.4 Host Hooks
9.9.4.1 HostEnqueueFinalizationRegistryCleanupJob ( finalizationRegistry )
The
Let cleanupJob be a new
- Let cleanupResult be
Completion (CleanupFinalizationRegistry (finalizationRegistry)). - If cleanupResult is an
abrupt completion , perform anyhost-defined steps for reporting the error. - Return
unused .
An implementation of HostEnqueueFinalizationRegistryCleanupJob schedules cleanupJob to be performed at some future time, if possible. It must also conform to the requirements in
9.10 ClearKeptObjects ( )
The abstract operation ClearKeptObjects takes no arguments and returns
- Let agentRecord be the
surrounding agent 'sAgent Record . - Set agentRecord.[[KeptAlive]] to a new empty
List . - Return
unused .
9.11 AddToKeptObjects ( value )
The abstract operation AddToKeptObjects takes argument value (an Object or a Symbol) and returns
- Let agentRecord be the
surrounding agent 'sAgent Record . - Append value to agentRecord.[[KeptAlive]].
- Return
unused .
9.12 CleanupFinalizationRegistry ( finalizationRegistry )
The abstract operation CleanupFinalizationRegistry takes argument finalizationRegistry (a
Assert : finalizationRegistry has [[Cells]] and [[CleanupCallback]] internal slots.- Let callback be finalizationRegistry.[[CleanupCallback]].
- While finalizationRegistry.[[Cells]] contains a
Record cell such that cell.[[WeakRefTarget]] isempty , an implementation may perform the following steps:- Choose any such cell.
- Remove cell from finalizationRegistry.[[Cells]].
- Perform ?
HostCallJobCallback (callback,undefined , « cell.[[HeldValue]] »).
- Return
unused .
9.13 CanBeHeldWeakly ( v )
The abstract operation CanBeHeldWeakly takes argument v (an
- If v
is an Object , returntrue . - If v
is a Symbol andKeyForSymbol (v) isundefined , returntrue . - Return
false .
A language value without