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
n
th
pin
1-9
Jump to the 10
th
pin
0
Jump to the most recent link target
`
Menu
Pins
clear
Table of Contents
Introduction
1
Scope
+
2
Conformance
2.1
Example Normative Optional Clause Heading
2.2
Example Legacy Clause Heading
2.3
Example Legacy Normative Optional Clause Heading
3
Normative References
+
4
Overview
4.1
Web Scripting
4.2
Hosts and Implementations
+
4.3
ECMAScript Overview
4.3.1
Objects
4.3.2
The Strict Variant of ECMAScript
+
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.1.1
Context-Free Grammars
5.1.2
The Lexical and RegExp Grammars
5.1.3
The Numeric String Grammar
5.1.4
The Syntactic Grammar
+
5.1.5
Grammar Notation
5.1.5.1
Terminal Symbols
5.1.5.2
Nonterminal Symbols and Productions
5.1.5.3
Optional Symbols
5.1.5.4
Grammatical Parameters
5.1.5.5
one of
5.1.5.6
[empty]
5.1.5.7
Lookahead Restrictions
5.1.5.8
[no
LineTerminator
here]
5.1.5.9
but not
5.1.5.10
Descriptive Phrases
+
5.2
Algorithm Conventions
5.2.1
Abstract Operations
5.2.2
Syntax-Directed Operations
+
5.2.3
Runtime Semantics
5.2.3.1
Completion (
completionRecord
)
5.2.3.2
Throw an Exception
5.2.3.3
ReturnIfAbrupt
5.2.3.4
ReturnIfAbrupt Shorthands
5.2.3.5
Implicit Normal Completion
5.2.4
Static Semantics
5.2.5
Mathematical Operations
5.2.6
Value Notation
5.2.7
Identity
+
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.4.1
StringIndexOf (
string
,
searchValue
,
fromIndex
)
6.1.4.2
StringLastIndexOf (
string
,
searchValue
,
fromIndex
)
+
6.1.5
The Symbol Type
6.1.5.1
Well-Known Symbols
+
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.7
The Object Type
6.1.7.1
Property Attributes
6.1.7.2
Object Internal Methods and Internal Slots
6.1.7.3
Invariants of the Essential Internal Methods
6.1.7.4
Well-Known Intrinsic Objects
+
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.4.1
NormalCompletion (
value
)
6.2.4.2
ThrowCompletion (
value
)
6.2.4.3
ReturnCompletion (
value
)
6.2.4.4
UpdateEmpty (
completionRecord
,
value
)
+
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.6.1
IsAccessorDescriptor (
Desc
)
6.2.6.2
IsDataDescriptor (
Desc
)
6.2.6.3
IsGenericDescriptor (
Desc
)
6.2.6.4
FromPropertyDescriptor (
Desc
)
6.2.6.5
ToPropertyDescriptor (
Obj
)
6.2.6.6
CompletePropertyDescriptor (
Desc
)
6.2.7
The Environment Record Specification Type
6.2.8
The Abstract Closure Specification Type
+
6.2.9
Data Blocks
6.2.9.1
CreateByteDataBlock (
size
)
6.2.9.2
CreateSharedByteDataBlock (
size
)
6.2.9.3
CopyDataBlockBytes (
toBlock
,
toIndex
,
fromBlock
,
fromIndex
,
count
)
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
+
7
Abstract Operations
+
7.1
Type Conversion
+
7.1.1
ToPrimitive (
input
[ ,
preferredType
] )
7.1.1.1
OrdinaryToPrimitive (
O
,
hint
)
7.1.2
ToBoolean (
argument
)
7.1.3
ToNumeric (
value
)
+
7.1.4
ToNumber (
argument
)
+
7.1.4.1
ToNumber Applied to the String Type
7.1.4.1.1
StringToNumber (
str
)
7.1.4.1.2
RS: StringNumericValue
7.1.4.1.3
RoundMVResult (
n
)
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.14.1
StringIntegerLiteral Grammar
7.1.14.2
RS: MV
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
)
+
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