Movatterモバイル変換


[0]ホーム

URL:


Pins
Table of Contents
  1. Introduction
  2. 1 Scope
  3. +2 Conformance
    1. 2.1 Example Normative Optional Clause Heading
    2. 2.2 Example Legacy Clause Heading
    3. 2.3 Example Legacy Normative Optional Clause Heading
  4. 3 Normative References
  5. +4 Overview
    1. 4.1 Web Scripting
    2. 4.2 Hosts and Implementations
    3. +4.3 ECMAScript Overview
      1. 4.3.1 Objects
      2. 4.3.2 The Strict Variant of ECMAScript
    4. +4.4 Terms and Definitions
      1. 4.4.1 implementation-approximated
      2. 4.4.2 implementation-defined
      3. 4.4.3 host-defined
      4. 4.4.4 type
      5. 4.4.5 primitive value
      6. 4.4.6 object
      7. 4.4.7 constructor
      8. 4.4.8 prototype
      9. 4.4.9 ordinary object
      10. 4.4.10 exotic object
      11. 4.4.11 standard object
      12. 4.4.12 built-in object
      13. 4.4.13 undefined value
      14. 4.4.14 Undefined type
      15. 4.4.15 null value
      16. 4.4.16 Null type
      17. 4.4.17 Boolean value
      18. 4.4.18 Boolean type
      19. 4.4.19 Boolean object
      20. 4.4.20 String value
      21. 4.4.21 String type
      22. 4.4.22 String object
      23. 4.4.23 Number value
      24. 4.4.24 Number type
      25. 4.4.25 Number object
      26. 4.4.26 Infinity
      27. 4.4.27 NaN
      28. 4.4.28 BigInt value
      29. 4.4.29 BigInt type
      30. 4.4.30 BigInt object
      31. 4.4.31 Symbol value
      32. 4.4.32 Symbol type
      33. 4.4.33 Symbol object
      34. 4.4.34 function
      35. 4.4.35 built-in function
      36. 4.4.36 built-in constructor
      37. 4.4.37 property
      38. 4.4.38 method
      39. 4.4.39 built-in method
      40. 4.4.40 attribute
      41. 4.4.41 own property
      42. 4.4.42 inherited property
    5. 4.5 Organization of This Specification
  6. +5 Notational Conventions
    1. +5.1 Syntactic and Lexical Grammars
      1. 5.1.1 Context-Free Grammars
      2. 5.1.2 The Lexical and RegExp Grammars
      3. 5.1.3 The Numeric String Grammar
      4. 5.1.4 The Syntactic Grammar
      5. +5.1.5 Grammar Notation
        1. 5.1.5.1 Terminal Symbols
        2. 5.1.5.2 Nonterminal Symbols and Productions
        3. 5.1.5.3 Optional Symbols
        4. 5.1.5.4 Grammatical Parameters
        5. 5.1.5.5 one of
        6. 5.1.5.6 [empty]
        7. 5.1.5.7 Lookahead Restrictions
        8. 5.1.5.8 [noLineTerminator here]
        9. 5.1.5.9 but not
        10. 5.1.5.10 Descriptive Phrases
    2. +5.2 Algorithm Conventions
      1. 5.2.1 Abstract Operations
      2. 5.2.2 Syntax-Directed Operations
      3. +5.2.3 Runtime Semantics
        1. 5.2.3.1 Completion (completionRecord )
        2. 5.2.3.2 Throw an Exception
        3. 5.2.3.3 ReturnIfAbrupt
        4. 5.2.3.4 ReturnIfAbrupt Shorthands
        5. 5.2.3.5 Implicit Normal Completion
      4. 5.2.4 Static Semantics
      5. 5.2.5 Mathematical Operations
      6. 5.2.6 Value Notation
      7. 5.2.7 Identity
  7. +6 ECMAScript Data Types and Values
    1. +6.1 ECMAScript Language Types
      1. 6.1.1 The Undefined Type
      2. 6.1.2 The Null Type
      3. 6.1.3 The Boolean Type
      4. +6.1.4 The String Type
        1. 6.1.4.1 StringIndexOf (string,searchValue,fromIndex )
        2. 6.1.4.2 StringLastIndexOf (string,searchValue,fromIndex )
      5. +6.1.5 The Symbol Type
        1. 6.1.5.1 Well-Known Symbols
      6. +6.1.6 Numeric Types
        1. +6.1.6.1 The Number Type
          1. 6.1.6.1.1 Number::unaryMinus (x )
          2. 6.1.6.1.2 Number::bitwiseNOT (x )
          3. 6.1.6.1.3 Number::exponentiate (base,exponent )
          4. 6.1.6.1.4 Number::multiply (x,y )
          5. 6.1.6.1.5 Number::divide (x,y )
          6. 6.1.6.1.6 Number::remainder (n,d )
          7. 6.1.6.1.7 Number::add (x,y )
          8. 6.1.6.1.8 Number::subtract (x,y )
          9. 6.1.6.1.9 Number::leftShift (x,y )
          10. 6.1.6.1.10 Number::signedRightShift (x,y )
          11. 6.1.6.1.11 Number::unsignedRightShift (x,y )
          12. 6.1.6.1.12 Number::lessThan (x,y )
          13. 6.1.6.1.13 Number::equal (x,y )
          14. 6.1.6.1.14 Number::sameValue (x,y )
          15. 6.1.6.1.15 Number::sameValueZero (x,y )
          16. 6.1.6.1.16 NumberBitwiseOp (op,x,y )
          17. 6.1.6.1.17 Number::bitwiseAND (x,y )
          18. 6.1.6.1.18 Number::bitwiseXOR (x,y )
          19. 6.1.6.1.19 Number::bitwiseOR (x,y )
          20. 6.1.6.1.20 Number::toString (x,radix )
        2. +6.1.6.2 The BigInt Type
          1. 6.1.6.2.1 BigInt::unaryMinus (x )
          2. 6.1.6.2.2 BigInt::bitwiseNOT (x )
          3. 6.1.6.2.3 BigInt::exponentiate (base,exponent )
          4. 6.1.6.2.4 BigInt::multiply (x,y )
          5. 6.1.6.2.5 BigInt::divide (x,y )
          6. 6.1.6.2.6 BigInt::remainder (n,d )
          7. 6.1.6.2.7 BigInt::add (x,y )
          8. 6.1.6.2.8 BigInt::subtract (x,y )
          9. 6.1.6.2.9 BigInt::leftShift (x,y )
          10. 6.1.6.2.10 BigInt::signedRightShift (x,y )
          11. 6.1.6.2.11 BigInt::unsignedRightShift (x,y )
          12. 6.1.6.2.12 BigInt::lessThan (x,y )
          13. 6.1.6.2.13 BigInt::equal (x,y )
          14. 6.1.6.2.14 BinaryAnd (x,y )
          15. 6.1.6.2.15 BinaryOr (x,y )
          16. 6.1.6.2.16 BinaryXor (x,y )
          17. 6.1.6.2.17 BigIntBitwiseOp (op,x,y )
          18. 6.1.6.2.18 BigInt::bitwiseAND (x,y )
          19. 6.1.6.2.19 BigInt::bitwiseXOR (x,y )
          20. 6.1.6.2.20 BigInt::bitwiseOR (x,y )
          21. 6.1.6.2.21 BigInt::toString (x,radix )
      7. +6.1.7 The Object Type
        1. 6.1.7.1 Property Attributes
        2. 6.1.7.2 Object Internal Methods and Internal Slots
        3. 6.1.7.3 Invariants of the Essential Internal Methods
        4. 6.1.7.4 Well-Known Intrinsic Objects
    2. +6.2 ECMAScript Specification Types
      1. 6.2.1 The Enum Specification Type
      2. 6.2.2 The List and Record Specification Types
      3. 6.2.3 The Set and Relation Specification Types
      4. +6.2.4 The Completion Record Specification Type
        1. 6.2.4.1 NormalCompletion (value )
        2. 6.2.4.2 ThrowCompletion (value )
        3. 6.2.4.3 ReturnCompletion (value )
        4. 6.2.4.4 UpdateEmpty (completionRecord,value )
      5. +6.2.5 The Reference Record Specification Type
        1. 6.2.5.1 IsPropertyReference (V )
        2. 6.2.5.2 IsUnresolvableReference (V )
        3. 6.2.5.3 IsSuperReference (V )
        4. 6.2.5.4 IsPrivateReference (V )
        5. 6.2.5.5 GetValue (V )
        6. 6.2.5.6 PutValue (V,W )
        7. 6.2.5.7 GetThisValue (V )
        8. 6.2.5.8 InitializeReferencedBinding (V,W )
        9. 6.2.5.9 MakePrivateReference (baseValue,privateIdentifier )
      6. +6.2.6 The Property Descriptor Specification Type
        1. 6.2.6.1 IsAccessorDescriptor (Desc )
        2. 6.2.6.2 IsDataDescriptor (Desc )
        3. 6.2.6.3 IsGenericDescriptor (Desc )
        4. 6.2.6.4 FromPropertyDescriptor (Desc )
        5. 6.2.6.5 ToPropertyDescriptor (Obj )
        6. 6.2.6.6 CompletePropertyDescriptor (Desc )
      7. 6.2.7 The Environment Record Specification Type
      8. 6.2.8 The Abstract Closure Specification Type
      9. +6.2.9 Data Blocks
        1. 6.2.9.1 CreateByteDataBlock (size )
        2. 6.2.9.2 CreateSharedByteDataBlock (size )
        3. 6.2.9.3 CopyDataBlockBytes (toBlock,toIndex,fromBlock,fromIndex,count )
      10. 6.2.10 The PrivateElement Specification Type
      11. 6.2.11 The ClassFieldDefinition Record Specification Type
      12. 6.2.12 Private Names
      13. 6.2.13 The ClassStaticBlockDefinition Record Specification Type
  8. +7 Abstract Operations
    1. +7.1 Type Conversion
      1. +7.1.1 ToPrimitive (input [ ,preferredType ] )
        1. 7.1.1.1 OrdinaryToPrimitive (O,hint )
      2. 7.1.2 ToBoolean (argument )
      3. 7.1.3 ToNumeric (value )
      4. +7.1.4 ToNumber (argument )
        1. +7.1.4.1 ToNumber Applied to the String Type
          1. 7.1.4.1.1 StringToNumber (str )
          2. 7.1.4.1.2 RS: StringNumericValue
          3. 7.1.4.1.3 RoundMVResult (n )
      5. 7.1.5 ToIntegerOrInfinity (argument )
      6. 7.1.6 ToInt32 (argument )
      7. 7.1.7 ToUint32 (argument )
      8. 7.1.8 ToInt16 (argument )
      9. 7.1.9 ToUint16 (argument )
      10. 7.1.10 ToInt8 (argument )
      11. 7.1.11 ToUint8 (argument )
      12. 7.1.12 ToUint8Clamp (argument )
      13. 7.1.13 ToBigInt (argument )
      14. +7.1.14 StringToBigInt (str )
        1. 7.1.14.1 StringIntegerLiteral Grammar
        2. 7.1.14.2 RS: MV
      15. 7.1.15 ToBigInt64 (argument )
      16. 7.1.16 ToBigUint64 (argument )
      17. 7.1.17 ToString (argument )
      18. 7.1.18 ToObject (argument )
      19. 7.1.19 ToPropertyKey (argument )
      20. 7.1.20 ToLength (argument )
      21. 7.1.21 CanonicalNumericIndexString (argument )
      22. 7.1.22 ToIndex (value )
    2. +7.2 Testing and Comparison Operations
      1. 7.2.1 RequireObjectCoercible (argument )
      2. 7.2.2 IsArray (argument )
      3. 7.2.3 IsCallable (argument )
      4. 7.2.4 IsConstructor (argument )
      5. 7.2.5 IsExtensible (O )
      6. 7.2.6 IsRegExp (argument )
      7. 7.2.7 SS: IsStringWellFormedUnicode (string )
      8. 7.2.8 SameType (x,y )
      9. 7.2.9 SameValue (x,y )
      10. 7.2.10 SameValueZero (x,y )
      11. 7.2.11 SameValueNonNumber (x,y )
      12. 7.2.12 IsLessThan (x,y,LeftFirst )
      13. 7.2.13 IsLooselyEqual (x,y )
      14. 7.2.14 IsStrictlyEqual (x,y )
    3. +7.3 Operations on Objects
      1. 7.3.1 MakeBasicObject (internalSlotsList )
      2. 7.3.2 Get (O,P )
      3. 7.3.3 GetV (V,P )
      4. 7.3.4 Set (O,P,V,Throw )
      5. 7.3.5 CreateDataProperty (O,P,V )
      6. 7.3.6 CreateDataPropertyOrThrow (O,P,V )
      7. 7.3.7 CreateNonEnumerableDataPropertyOrThrow (O,P,V )
      8. 7.3.8 DefinePropertyOrThrow (O,P,desc )
      9. 7.3.9 DeletePropertyOrThrow (O,P )
      10. 7.3.10 GetMethod (V,P )
      11. 7.3.11 HasProperty (O,P )
      12. 7.3.12 HasOwnProperty (O,P )
      13. 7.3.13 Call (F,V [ ,argumentsList ] )
      14. 7.3.14 Construct (F [ ,argumentsList [ ,newTarget ] ] )
      15. 7.3.15 SetIntegrityLevel (O,level )
      16. 7.3.16 TestIntegrityLevel (O,level )
      17. 7.3.17 CreateArrayFromList (elements )
      18. 7.3.18 LengthOfArrayLike (obj )
      19. 7.3.19 CreateListFromArrayLike (obj [ ,validElementTypes ] )
      20. 7.3.20 Invoke (V,P [ ,argumentsList ] )
      21. 7.3.21 OrdinaryHasInstance (C,O )
      22. 7.3.22 SpeciesConstructor (O,defaultConstructor )
      23. 7.3.23 EnumerableOwnProperties (O,kind )
      24. 7.3.24 GetFunctionRealm (obj )
      25. 7.3.25 CopyDataProperties (target,source,excludedItems )
      26. 7.3.26 PrivateElementFind (O,P )
      27. 7.3.27 PrivateFieldAdd (O,P,value )
      28. 7.3.28 PrivateMethodOrAccessorAdd (O,method )
      29. 7.3.29 HostEnsureCanAddPrivateElement (O )
      30. 7.3.30 PrivateGet (O,P )
      31. 7.3.31 PrivateSet (O,P,value )
      32. 7.3.32 DefineField (receiver,fieldRecord )
      33. 7.3.33 InitializeInstanceElements (O,constructor )
      34. 7.3.34 AddValueToKeyedGroup (groups,key,value )
      35. 7.3.35 GroupBy (items,callback,keyCoercion )
      36. 7.3.36 GetOptionsObject (options )
      37. 7.3.37 SetterThatIgnoresPrototypeProperties (thisValue,home,p,v )
    4. +7.4 Operations on Iterator Objects
      1. 7.4.1 Iterator Records
      2. 7.4.2 GetIteratorDirect (obj )
      3. 7.4.3 GetIteratorFromMethod (obj,method )
      4. 7.4.4 GetIterator (obj,kind )
      5. 7.4.5 GetIteratorFlattenable (obj,primitiveHandling )
      6. 7.4.6 IteratorNext (iteratorRecord [ ,value ] )
      7. 7.4.7 IteratorComplete (iteratorResult )
      8. 7.4.8 IteratorValue (iteratorResult )
      9. 7.4.9 IteratorStep (iteratorRecord )
      10. 7.4.10 IteratorStepValue (iteratorRecord )
      11. 7.4.11 IteratorClose (iteratorRecord,completion )
      12. 7.4.12 IfAbruptCloseIterator (value,iteratorRecord )
      13. 7.4.13 AsyncIteratorClose (iteratorRecord,completion )
      14. 7.4.14 CreateIteratorResultObject (value,done )
      15. 7.4.15 CreateListIteratorRecord (list )
      16. 7.4.16 IteratorToList (iteratorRecord )
  9. +8 Syntax-Directed Operations
    1. 8.1 RS: Evaluation
    2. +8.2 Scope Analysis
      1. 8.2.1 SS: BoundNames
      2. 8.2.2 SS: DeclarationPart
      3. 8.2.3 SS: IsConstantDeclaration
      4. 8.2.4 SS: LexicallyDeclaredNames
      5. 8.2.5 SS: LexicallyScopedDeclarations
      6. 8.2.6 SS: VarDeclaredNames
      7. 8.2.7 SS: VarScopedDeclarations
      8. 8.2.8 SS: TopLevelLexicallyDeclaredNames
      9. 8.2.9 SS: TopLevelLexicallyScopedDeclarations
      10. 8.2.10 SS: TopLevelVarDeclaredNames
      11. 8.2.11 SS: TopLevelVarScopedDeclarations
    3. +8.3 Labels
      1. 8.3.1 SS: ContainsDuplicateLabels
      2. 8.3.2 SS: ContainsUndefinedBreakTarget
      3. 8.3.3 SS: ContainsUndefinedContinueTarget
    4. +8.4 Function Name Inference
      1. 8.4.1 SS: HasName
      2. 8.4.2 SS: IsFunctionDefinition
      3. 8.4.3 SS: IsAnonymousFunctionDefinition (expr )
      4. 8.4.4 SS: IsIdentifierRef
      5. 8.4.5 RS: NamedEvaluation
    5. +8.5 Contains
      1. 8.5.1 SS: Contains
      2. 8.5.2 SS: ComputedPropertyContains
    6. +8.6 Miscellaneous
      1. 8.6.1 RS: InstantiateFunctionObject
      2. +8.6.2 RS: BindingInitialization
        1. 8.6.2.1 InitializeBoundName (name,value,environment )
      3. 8.6.3 RS: IteratorBindingInitialization
      4. 8.6.4 SS: AssignmentTargetType
      5. 8.6.5 SS: PropName
  10. +9 Executable Code and Execution Contexts
    1. +9.1 Environment Records
      1. +9.1.1 The Environment Record Type Hierarchy
        1. +9.1.1.1 Declarative Environment Records
          1. 9.1.1.1.1 HasBinding (N )
          2. 9.1.1.1.2 CreateMutableBinding (N,D )
          3. 9.1.1.1.3 CreateImmutableBinding (N,S )
          4. 9.1.1.1.4 InitializeBinding (N,V )
          5. 9.1.1.1.5 SetMutableBinding (N,V,S )
          6. 9.1.1.1.6 GetBindingValue (N,S )
          7. 9.1.1.1.7 DeleteBinding (N )
          8. 9.1.1.1.8 HasThisBinding ( )
          9. 9.1.1.1.9 HasSuperBinding ( )
          10. 9.1.1.1.10 WithBaseObject ( )
        2. +9.1.1.2 Object Environment Records
          1. 9.1.1.2.1 HasBinding (N )
          2. 9.1.1.2.2 CreateMutableBinding (N,D )
          3. 9.1.1.2.3 CreateImmutableBinding (N,S )
          4. 9.1.1.2.4 InitializeBinding (N,V )
          5. 9.1.1.2.5 SetMutableBinding (N,V,S )
          6. 9.1.1.2.6 GetBindingValue (N,S )
          7. 9.1.1.2.7 DeleteBinding (N )
          8. 9.1.1.2.8 HasThisBinding ( )
          9. 9.1.1.2.9 HasSuperBinding ( )
          10. 9.1.1.2.10 WithBaseObject ( )
        3. +9.1.1.3 Function Environment Records
          1. 9.1.1.3.1 BindThisValue (envRec,V )
          2. 9.1.1.3.2 HasThisBinding ( )
          3. 9.1.1.3.3 HasSuperBinding ( )
          4. 9.1.1.3.4 GetThisBinding ( )
          5. 9.1.1.3.5 GetSuperBase (envRec )
        4. +9.1.1.4 Global Environment Records
          1. 9.1.1.4.1 HasBinding (N )
          2. 9.1.1.4.2 CreateMutableBinding (N,D )
          3. 9.1.1.4.3 CreateImmutableBinding (N,S )
          4. 9.1.1.4.4 InitializeBinding (N,V )
          5. 9.1.1.4.5 SetMutableBinding (N,V,S )
          6. 9.1.1.4.6 GetBindingValue (N,S )
          7. 9.1.1.4.7 DeleteBinding (N )
          8. 9.1.1.4.8 HasThisBinding ( )
          9. 9.1.1.4.9 HasSuperBinding ( )
          10. 9.1.1.4.10 WithBaseObject ( )
          11. 9.1.1.4.11 GetThisBinding ( )
          12. 9.1.1.4.12 HasLexicalDeclaration (envRec,N )
          13. 9.1.1.4.13 HasRestrictedGlobalProperty (envRec,N )
          14. 9.1.1.4.14 CanDeclareGlobalVar (envRec,N )
          15. 9.1.1.4.15 CanDeclareGlobalFunction (envRec,N )
          16. 9.1.1.4.16 CreateGlobalVarBinding (envRec,N,D )
          17. 9.1.1.4.17 CreateGlobalFunctionBinding (envRec,N,V,D )
        5. +9.1.1.5 Module Environment Records
          1. 9.1.1.5.1 GetBindingValue (N,S )
          2. 9.1.1.5.2 DeleteBinding (N )
          3. 9.1.1.5.3 HasThisBinding ( )
          4. 9.1.1.5.4 GetThisBinding ( )
          5. 9.1.1.5.5 CreateImportBinding (envRec,N,M,N2 )
      2. +9.1.2 Environment Record Operations
        1. 9.1.2.1 GetIdentifierReference (env,name,strict )
        2. 9.1.2.2 NewDeclarativeEnvironment (E )
        3. 9.1.2.3 NewObjectEnvironment (O,W,E )
        4. 9.1.2.4 NewFunctionEnvironment (F,newTarget )
        5. 9.1.2.5 NewGlobalEnvironment (G,thisValue )
        6. 9.1.2.6 NewModuleEnvironment (E )
    2. +9.2 PrivateEnvironment Records
      1. +9.2.1 PrivateEnvironment Record Operations
        1. 9.2.1.1 NewPrivateEnvironment (outerPrivateEnv )
        2. 9.2.1.2 ResolvePrivateIdentifier (privateEnv,identifier )
    3. +9.3 Realms
      1. 9.3.1 InitializeHostDefinedRealm ( )
      2. 9.3.2 CreateIntrinsics (realmRec )
      3. 9.3.3 SetDefaultGlobalBindings (realmRec )
    4. +9.4 Execution Contexts
      1. 9.4.1 GetActiveScriptOrModule ( )
      2. 9.4.2 ResolveBinding (name [ ,env ] )
      3. 9.4.3 GetThisEnvironment ( )
      4. 9.4.4 ResolveThisBinding ( )
      5. 9.4.5 GetNewTarget ( )
      6. 9.4.6 GetGlobalObject ( )
    5. +9.5 Jobs and Host Operations to Enqueue Jobs
      1. 9.5.1 JobCallback Records
      2. 9.5.2 HostMakeJobCallback (callback )
      3. 9.5.3 HostCallJobCallback (jobCallback,V,argumentsList )
      4. 9.5.4 HostEnqueueGenericJob (job,realm )
      5. 9.5.5 HostEnqueuePromiseJob (job,realm )
      6. 9.5.6 HostEnqueueTimeoutJob (timeoutJob,realm,milliseconds )
    6. +9.6 Agents
      1. 9.6.1 AgentSignifier ( )
      2. 9.6.2 AgentCanSuspend ( )
      3. 9.6.3 IncrementModuleAsyncEvaluationCount ( )
    7. 9.7 Agent Clusters
    8. 9.8 Forward Progress
    9. +9.9 Processing Model of WeakRef and FinalizationRegistry Targets
      1. 9.9.1 Objectives
      2. 9.9.2 Liveness
      3. 9.9.3 Execution
      4. +9.9.4 Host Hooks
        1. 9.9.4.1 HostEnqueueFinalizationRegistryCleanupJob (finalizationRegistry )
    10. 9.10 ClearKeptObjects ( )
    11. 9.11 AddToKeptObjects (value )
    12. 9.12 CleanupFinalizationRegistry (finalizationRegistry )
    13. 9.13 CanBeHeldWeakly (v )
  11. +10 Ordinary and Exotic Objects Behaviours
    1. +10.1 Ordinary Object Internal Methods and Internal Slots
      1. +10.1.1[[GetPrototypeOf]] ( )
        1. 10.1.1.1 OrdinaryGetPrototypeOf (O )
      2. +10.1.2[[SetPrototypeOf]] (V )
        1. 10.1.2.1 OrdinarySetPrototypeOf (O,V )
      3. +10.1.3[[IsExtensible]] ( )
        1. 10.1.3.1 OrdinaryIsExtensible (O )
      4. +10.1.4[[PreventExtensions]] ( )
        1. 10.1.4.1 OrdinaryPreventExtensions (O )
      5. +10.1.5[[GetOwnProperty]] (P )
        1. 10.1.5.1 OrdinaryGetOwnProperty (O,P )
      6. +10.1.6[[DefineOwnProperty]] (P,Desc )
        1. 10.1.6.1 OrdinaryDefineOwnProperty (O,P,Desc )
        2. 10.1.6.2 IsCompatiblePropertyDescriptor (Extensible,Desc,Current )
        3. 10.1.6.3 ValidateAndApplyPropertyDescriptor (O,P,extensible,Desc,current )
      7. +10.1.7[[HasProperty]] (P )
        1. 10.1.7.1 OrdinaryHasProperty (O,P )
      8. +10.1.8[[Get]] (P,Receiver )
        1. 10.1.8.1 OrdinaryGet (O,P,Receiver )
      9. +10.1.9[[Set]] (P,V,Receiver )
        1. 10.1.9.1 OrdinarySet (O,P,V,Receiver )
        2. 10.1.9.2 OrdinarySetWithOwnDescriptor (O,P,V,Receiver,ownDesc )
      10. +10.1.10[[Delete]] (P )
        1. 10.1.10.1 OrdinaryDelete (O,P )
      11. +10.1.11[[OwnPropertyKeys]] ( )
        1. 10.1.11.1 OrdinaryOwnPropertyKeys (O )
      12. 10.1.12 OrdinaryObjectCreate (proto [ ,additionalInternalSlotsList ] )
      13. 10.1.13 OrdinaryCreateFromConstructor (constructor,intrinsicDefaultProto [ ,internalSlotsList ] )
      14. 10.1.14 GetPrototypeFromConstructor (constructor,intrinsicDefaultProto )
      15. 10.1.15 RequireInternalSlot (O,internalSlot )
    2. +10.2 ECMAScript Function Objects
      1. +10.2.1[[Call]] (thisArgument,argumentsList )
        1. 10.2.1.1 PrepareForOrdinaryCall (F,newTarget )
        2. 10.2.1.2 OrdinaryCallBindThis (F,calleeContext,thisArgument )
        3. 10.2.1.3 RS: EvaluateBody
        4. 10.2.1.4 OrdinaryCallEvaluateBody (F,argumentsList )
      2. 10.2.2[[Construct]] (argumentsList,newTarget )
      3. 10.2.3 OrdinaryFunctionCreate (functionPrototype,sourceText,ParameterList,Body,thisMode,env,privateEnv )
      4. +10.2.4 AddRestrictedFunctionProperties (F,realm )
        1. 10.2.4.1 %ThrowTypeError% ( )
      5. 10.2.5 MakeConstructor (F [ ,writablePrototype [ ,prototype ] ] )
      6. 10.2.6 MakeClassConstructor (F )
      7. 10.2.7 MakeMethod (F,homeObject )
      8. 10.2.8 DefineMethodProperty (homeObject,key,closure,enumerable )
      9. 10.2.9 SetFunctionName (F,name [ ,prefix ] )
      10. 10.2.10 SetFunctionLength (F,length )
      11. 10.2.11 FunctionDeclarationInstantiation (func,argumentsList )
    3. +10.3 Built-in Function Objects
      1. 10.3.1[[Call]] (thisArgument,argumentsList )
      2. 10.3.2[[Construct]] (argumentsList,newTarget )
      3. 10.3.3 BuiltinCallOrConstruct (F,thisArgument,argumentsList,newTarget )
      4. 10.3.4 CreateBuiltinFunction (behaviour,length,name,additionalInternalSlotsList [ ,realm [ ,prototype [ ,prefix ] ] ] )
    4. +10.4 Built-in Exotic Object Internal Methods and Slots
      1. +10.4.1 Bound Function Exotic Objects
        1. 10.4.1.1[[Call]] (thisArgument,argumentsList )
        2. 10.4.1.2[[Construct]] (argumentsList,newTarget )
        3. 10.4.1.3 BoundFunctionCreate (targetFunction,boundThis,boundArgs )
      2. +10.4.2 Array Exotic Objects
        1. 10.4.2.1[[DefineOwnProperty]] (P,Desc )
        2. 10.4.2.2 ArrayCreate (length [ ,proto ] )
        3. 10.4.2.3 ArraySpeciesCreate (originalArray,length )
        4. 10.4.2.4 ArraySetLength (A,Desc )
      3. +10.4.3 String Exotic Objects
        1. 10.4.3.1[[GetOwnProperty]] (P )
        2. 10.4.3.2[[DefineOwnProperty]] (P,Desc )
        3. 10.4.3.3[[OwnPropertyKeys]] ( )
        4. 10.4.3.4 StringCreate (value,prototype )
        5. 10.4.3.5 StringGetOwnProperty (S,P )
      4. +10.4.4 Arguments Exotic Objects
        1. 10.4.4.1[[GetOwnProperty]] (P )
        2. 10.4.4.2[[DefineOwnProperty]] (P,Desc )
        3. 10.4.4.3[[Get]] (P,Receiver )
        4. 10.4.4.4[[Set]] (P,V,Receiver )
        5. 10.4.4.5[[Delete]] (P )
        6. 10.4.4.6 CreateUnmappedArgumentsObject (argumentsList )
        7. +10.4.4.7 CreateMappedArgumentsObject (func,formals,argumentsList,env )
          1. 10.4.4.7.1 MakeArgGetter (name,env )
          2. 10.4.4.7.2 MakeArgSetter (name,env )
      5. +10.4.5 TypedArray Exotic Objects
        1. 10.4.5.1[[PreventExtensions]] ( )
        2. 10.4.5.2[[GetOwnProperty]] (P )
        3. 10.4.5.3[[HasProperty]] (P )
        4. 10.4.5.4[[DefineOwnProperty]] (P,Desc )
        5. 10.4.5.5[[Get]] (P,Receiver )
        6. 10.4.5.6[[Set]] (P,V,Receiver )
        7. 10.4.5.7[[Delete]] (P )
        8. 10.4.5.8[[OwnPropertyKeys]] ( )
        9. 10.4.5.9 TypedArray With Buffer Witness Records
        10. 10.4.5.10 MakeTypedArrayWithBufferWitnessRecord (obj,order )
        11. 10.4.5.11 TypedArrayCreate (prototype )
        12. 10.4.5.12 TypedArrayByteLength (taRecord )
        13. 10.4.5.13 TypedArrayLength (taRecord )
        14. 10.4.5.14 IsTypedArrayOutOfBounds (taRecord )
        15. 10.4.5.15 IsTypedArrayFixedLength (O )
        16. 10.4.5.16 IsValidIntegerIndex (O,index )
        17. 10.4.5.17 TypedArrayGetElement (O,index )
        18. 10.4.5.18 TypedArraySetElement (O,index,value )
        19. 10.4.5.19 IsArrayBufferViewOutOfBounds (O )
      6. +10.4.6 Module Namespace Exotic Objects
        1. 10.4.6.1[[GetPrototypeOf]] ( )
        2. 10.4.6.2[[SetPrototypeOf]] (V )
        3. 10.4.6.3[[IsExtensible]] ( )
        4. 10.4.6.4[[PreventExtensions]] ( )
        5. 10.4.6.5[[GetOwnProperty]] (P )
        6. 10.4.6.6[[DefineOwnProperty]] (P,Desc )
        7. 10.4.6.7[[HasProperty]] (P )
        8. 10.4.6.8[[Get]] (P,Receiver )
        9. 10.4.6.9[[Set]] (P,V,Receiver )
        10. 10.4.6.10[[Delete]] (P )
        11. 10.4.6.11[[OwnPropertyKeys]] ( )
        12. 10.4.6.12 ModuleNamespaceCreate (module,exports )
      7. +10.4.7 Immutable Prototype Exotic Objects
        1. 10.4.7.1[[SetPrototypeOf]] (V )
        2. 10.4.7.2 SetImmutablePrototype (O,V )
    5. +10.5 Proxy Object Internal Methods and Internal Slots
      1. 10.5.1[[GetPrototypeOf]] ( )
      2. 10.5.2[[SetPrototypeOf]] (V )
      3. 10.5.3[[IsExtensible]] ( )
      4. 10.5.4[[PreventExtensions]] ( )
      5. 10.5.5[[GetOwnProperty]] (P )
      6. 10.5.6[[DefineOwnProperty]] (P,Desc )
      7. 10.5.7[[HasProperty]] (P )
      8. 10.5.8[[Get]] (P,Receiver )
      9. 10.5.9[[Set]] (P,V,Receiver )
      10. 10.5.10[[Delete]] (P )
      11. 10.5.11[[OwnPropertyKeys]] ( )
      12. 10.5.12[[Call]] (thisArgument,argumentsList )
      13. 10.5.13[[Construct]] (argumentsList,newTarget )
      14. 10.5.14 ValidateNonRevokedProxy (proxy )
      15. 10.5.15 ProxyCreate (target,handler )
  12. +11 ECMAScript Language: Source Text
    1. +11.1 Source Text
      1. 11.1.1 SS: UTF16EncodeCodePoint (cp )
      2. 11.1.2 SS: CodePointsToString (text )
      3. 11.1.3 SS: UTF16SurrogatePairToCodePoint (lead,trail )
      4. 11.1.4 SS: CodePointAt (string,position )
      5. 11.1.5 SS: StringToCodePoints (string )
      6. 11.1.6 SS: ParseText (sourceText,goalSymbol )
    2. +11.2 Types of Source Code
      1. 11.2.1 Directive Prologues and the Use Strict Directive
      2. +11.2.2 Strict Mode Code
        1. 11.2.2.1 SS: IsStrict (node )
      3. 11.2.3 Non-ECMAScript Functions
  13. +12 ECMAScript Language: Lexical Grammar
    1. 12.1 Unicode Format-Control Characters
    2. 12.2 White Space
    3. 12.3 Line Terminators
    4. 12.4 Comments
    5. 12.5 Hashbang Comments
    6. 12.6 Tokens
    7. +12.7 Names and Keywords
      1. +12.7.1 Identifier Names
        1. 12.7.1.1 SS: Early Errors
        2. 12.7.1.2 SS: IdentifierCodePoints
        3. 12.7.1.3 SS: IdentifierCodePoint
      2. 12.7.2 Keywords and Reserved Words
    8. 12.8 Punctuators
    9. +12.9 Literals
      1. 12.9.1 Null Literals
      2. 12.9.2 Boolean Literals
      3. +12.9.3 Numeric Literals
        1. 12.9.3.1 SS: Early Errors
        2. 12.9.3.2 SS: MV
        3. 12.9.3.3 SS: NumericValue
      4. +12.9.4 String Literals
        1. 12.9.4.1 SS: Early Errors
        2. 12.9.4.2 SS: SV
        3. 12.9.4.3 SS: MV
      5. +12.9.5 Regular Expression Literals
        1. 12.9.5.1 SS: BodyText
        2. 12.9.5.2 SS: FlagText
      6. +12.9.6 Template Literal Lexical Components
        1. 12.9.6.1 SS: TV
        2. 12.9.6.2 SS: TRV
    10. +12.10 Automatic Semicolon Insertion
      1. 12.10.1 Rules of Automatic Semicolon Insertion
      2. 12.10.2 Examples of Automatic Semicolon Insertion
      3. +12.10.3 Interesting Cases of Automatic Semicolon Insertion
        1. 12.10.3.1 Interesting Cases of Automatic Semicolon Insertion in Statement Lists
        2. +12.10.3.2 Cases of Automatic Semicolon Insertion and “[noLineTerminator here]”
          1. 12.10.3.2.1 List of Grammar Productions with Optional Operands and “[noLineTerminator here]”
  14. +13 ECMAScript Language: Expressions
    1. +13.1 Identifiers
      1. 13.1.1 SS: Early Errors
      2. 13.1.2 SS: StringValue
      3. 13.1.3 RS: Evaluation
    2. +13.2 Primary Expression
      1. +13.2.1 Thethis Keyword
        1. 13.2.1.1 RS: Evaluation
      2. 13.2.2 Identifier Reference
      3. +13.2.3 Literals
        1. 13.2.3.1 RS: Evaluation
      4. +13.2.4 Array Initializer
        1. 13.2.4.1 RS: ArrayAccumulation
        2. 13.2.4.2 RS: Evaluation
      5. +13.2.5 Object Initializer
        1. 13.2.5.1 SS: Early Errors
        2. 13.2.5.2 SS: IsComputedPropertyKey
        3. 13.2.5.3 SS: PropertyNameList
        4. 13.2.5.4 RS: Evaluation
        5. 13.2.5.5 RS: PropertyDefinitionEvaluation
      6. 13.2.6 Function Defining Expressions
      7. +13.2.7 Regular Expression Literals
        1. 13.2.7.1 SS: Early Errors
        2. 13.2.7.2 SS: IsValidRegularExpressionLiteral (literal )
        3. 13.2.7.3 RS: Evaluation
      8. +13.2.8 Template Literals
        1. 13.2.8.1 SS: Early Errors
        2. 13.2.8.2 SS: TemplateStrings
        3. 13.2.8.3 SS: TemplateString (templateToken,raw )
        4. 13.2.8.4 GetTemplateObject (templateLiteral )
        5. 13.2.8.5 RS: SubstitutionEvaluation
        6. 13.2.8.6 RS: Evaluation
      9. +13.2.9 The Grouping Operator
        1. 13.2.9.1 SS: Early Errors
        2. 13.2.9.2 RS: Evaluation
    3. +13.3 Left-Hand-Side Expressions
      1. +13.3.1 Static Semantics
        1. 13.3.1.1 SS: Early Errors
      2. +13.3.2 Property Accessors
        1. 13.3.2.1 RS: Evaluation
      3. 13.3.3 EvaluatePropertyAccessWithExpressionKey (baseValue,expression,strict )
      4. 13.3.4 EvaluatePropertyAccessWithIdentifierKey (baseValue,identifierName,strict )
      5. +13.3.5 Thenew Operator
        1. +13.3.5.1 RS: Evaluation
          1. 13.3.5.1.1 EvaluateNew (constructExpr,arguments )
      6. +13.3.6 Function Calls
        1. 13.3.6.1 RS: Evaluation
        2. 13.3.6.2 EvaluateCall (func,ref,arguments,tailPosition )
      7. +13.3.7 Thesuper Keyword
        1. 13.3.7.1 RS: Evaluation
        2. 13.3.7.2 GetSuperConstructor ( )
        3. 13.3.7.3 MakeSuperPropertyReference (actualThis,propertyKey,strict )
      8. +13.3.8 Argument Lists
        1. 13.3.8.1 RS: ArgumentListEvaluation
      9. +13.3.9 Optional Chains
        1. 13.3.9.1 RS: Evaluation
        2. 13.3.9.2 RS: ChainEvaluation
      10. +13.3.10 Import Calls
        1. 13.3.10.1 RS: Evaluation
        2. 13.3.10.2 EvaluateImportCall (specifierExpression [ ,optionsExpression ] )
        3. 13.3.10.3 ContinueDynamicImport (promiseCapability,moduleCompletion )
      11. +13.3.11 Tagged Templates
        1. 13.3.11.1 RS: Evaluation
      12. +13.3.12 Meta Properties
        1. +13.3.12.1 RS: Evaluation
          1. 13.3.12.1.1 HostGetImportMetaProperties (moduleRecord )
          2. 13.3.12.1.2 HostFinalizeImportMeta (importMeta,moduleRecord )
    4. +13.4 Update Expressions
      1. 13.4.1 SS: Early Errors
      2. +13.4.2 Postfix Increment Operator
        1. 13.4.2.1 RS: Evaluation
      3. +13.4.3 Postfix Decrement Operator
        1. 13.4.3.1 RS: Evaluation
      4. +13.4.4 Prefix Increment Operator
        1. 13.4.4.1 RS: Evaluation
      5. +13.4.5 Prefix Decrement Operator
        1. 13.4.5.1 RS: Evaluation
    5. +13.5 Unary Operators
      1. +13.5.1 Thedelete Operator
        1. 13.5.1.1 SS: Early Errors
        2. 13.5.1.2 RS: Evaluation
      2. +13.5.2 Thevoid Operator
        1. 13.5.2.1 RS: Evaluation
      3. +13.5.3 Thetypeof Operator
        1. 13.5.3.1 RS: Evaluation
      4. +13.5.4 Unary+ Operator
        1. 13.5.4.1 RS: Evaluation
      5. +13.5.5 Unary- Operator
        1. 13.5.5.1 RS: Evaluation
      6. +13.5.6 Bitwise NOT Operator (~ )
        1. 13.5.6.1 RS: Evaluation
      7. +13.5.7 Logical NOT Operator (! )
        1. 13.5.7.1 RS: Evaluation
    6. +13.6 Exponentiation Operator
      1. 13.6.1 RS: Evaluation
    7. +13.7 Multiplicative Operators
      1. 13.7.1 RS: Evaluation
    8. +13.8 Additive Operators
      1. +13.8.1 The Addition Operator (+ )
        1. 13.8.1.1 RS: Evaluation
      2. +13.8.2 The Subtraction Operator (- )
        1. 13.8.2.1 RS: Evaluation
    9. +13.9 Bitwise Shift Operators
      1. +13.9.1 The Left Shift Operator (<< )
        1. 13.9.1.1 RS: Evaluation
      2. +13.9.2 The Signed Right Shift Operator (>> )
        1. 13.9.2.1 RS: Evaluation
      3. +13.9.3 The Unsigned Right Shift Operator (>>> )
        1. 13.9.3.1 RS: Evaluation
    10. +13.10 Relational Operators
      1. 13.10.1 RS: Evaluation
      2. 13.10.2 InstanceofOperator (V,target )
    11. +13.11 Equality Operators
      1. 13.11.1 RS: Evaluation
    12. +13.12 Binary Bitwise Operators
      1. 13.12.1 RS: Evaluation
    13. +13.13 Binary Logical Operators
      1. 13.13.1 RS: Evaluation
    14. +13.14 Conditional Operator (? : )
      1. 13.14.1 RS: Evaluation
    15. +13.15 Assignment Operators
      1. 13.15.1 SS: Early Errors
      2. 13.15.2 RS: Evaluation
      3. 13.15.3 ApplyStringOrNumericBinaryOperator (lVal,opText,rVal )
      4. 13.15.4 EvaluateStringOrNumericBinaryExpression (leftOperand,opText,rightOperand )
      5. +13.15.5 Destructuring Assignment
        1. 13.15.5.1 SS: Early Errors
        2. 13.15.5.2 RS: DestructuringAssignmentEvaluation
        3. 13.15.5.3 RS: PropertyDestructuringAssignmentEvaluation
        4. 13.15.5.4 RS: RestDestructuringAssignmentEvaluation
        5. 13.15.5.5 RS: IteratorDestructuringAssignmentEvaluation
        6. 13.15.5.6 RS: KeyedDestructuringAssignmentEvaluation
    16. +13.16 Comma Operator (, )
      1. 13.16.1 RS: Evaluation
  15. +14 ECMAScript Language: Statements and Declarations
    1. +14.1 Statement Semantics
      1. 14.1.1 RS: Evaluation
    2. +14.2 Block
      1. 14.2.1 SS: Early Errors
      2. 14.2.2 RS: Evaluation
      3. 14.2.3 BlockDeclarationInstantiation (code,env )
    3. +14.3 Declarations and the Variable Statement
      1. +14.3.1 Let and Const Declarations
        1. 14.3.1.1 SS: Early Errors
        2. 14.3.1.2 RS: Evaluation
      2. +14.3.2 Variable Statement
        1. 14.3.2.1 RS: Evaluation
      3. +14.3.3 Destructuring Binding Patterns
        1. 14.3.3.1 RS: PropertyBindingInitialization
        2. 14.3.3.2 RS: RestBindingInitialization
        3. 14.3.3.3 RS: KeyedBindingInitialization
    4. +14.4 Empty Statement
      1. 14.4.1 RS: Evaluation
    5. +14.5 Expression Statement
      1. 14.5.1 RS: Evaluation
    6. +14.6 Theif Statement
      1. 14.6.1 SS: Early Errors
      2. 14.6.2 RS: Evaluation
    7. +14.7 Iteration Statements
      1. +14.7.1 Semantics
        1. 14.7.1.1 LoopContinues (completion,labelSet )
        2. 14.7.1.2 RS: LoopEvaluation
      2. +14.7.2 Thedo-while Statement
        1. 14.7.2.1 SS: Early Errors
        2. 14.7.2.2 RS: DoWhileLoopEvaluation
      3. +14.7.3 Thewhile Statement
        1. 14.7.3.1 SS: Early Errors
        2. 14.7.3.2 RS: WhileLoopEvaluation
      4. +14.7.4 Thefor Statement
        1. 14.7.4.1 SS: Early Errors
        2. 14.7.4.2 RS: ForLoopEvaluation
        3. 14.7.4.3 ForBodyEvaluation (test,increment,stmt,perIterationBindings,labelSet )
        4. 14.7.4.4 CreatePerIterationEnvironment (perIterationBindings )
      5. +14.7.5 Thefor-in,for-of, andfor-await-of Statements
        1. 14.7.5.1 SS: Early Errors
        2. 14.7.5.2 SS: IsDestructuring
        3. 14.7.5.3 RS: ForDeclarationBindingInitialization
        4. 14.7.5.4 RS: ForDeclarationBindingInstantiation
        5. 14.7.5.5 RS: ForInOfLoopEvaluation
        6. 14.7.5.6 ForIn/OfHeadEvaluation (uninitializedBoundNames,expr,iterationKind )
        7. 14.7.5.7 ForIn/OfBodyEvaluation (lhs,stmt,iteratorRecord,iterationKind,lhsKind,labelSet [ ,iteratorKind ] )
        8. 14.7.5.8 RS: Evaluation
        9. 14.7.5.9 EnumerateObjectProperties (O )
        10. +14.7.5.10 For-In Iterator Objects
          1. 14.7.5.10.1 CreateForInIterator (object )
          2. +14.7.5.10.2 The %ForInIteratorPrototype% Object
            1. 14.7.5.10.2.1 %ForInIteratorPrototype%.next ( )
          3. 14.7.5.10.3 Properties of For-In Iterator Instances
    8. +14.8 Thecontinue Statement
      1. 14.8.1 SS: Early Errors
      2. 14.8.2 RS: Evaluation
    9. +14.9 Thebreak Statement
      1. 14.9.1 SS: Early Errors
      2. 14.9.2 RS: Evaluation
    10. +14.10 Thereturn Statement
      1. 14.10.1 RS: Evaluation
    11. +14.11 Thewith Statement
      1. 14.11.1 SS: Early Errors
      2. 14.11.2 RS: Evaluation
    12. +14.12 Theswitch Statement
      1. 14.12.1 SS: Early Errors
      2. 14.12.2 RS: CaseBlockEvaluation
      3. 14.12.3 CaseClauseIsSelected (C,input )
      4. 14.12.4 RS: Evaluation
    13. +14.13 Labelled Statements
      1. 14.13.1 SS: Early Errors
      2. 14.13.2 SS: IsLabelledFunction (stmt )
      3. 14.13.3 RS: Evaluation
      4. 14.13.4 RS: LabelledEvaluation
    14. +14.14 Thethrow Statement
      1. 14.14.1 RS: Evaluation
    15. +14.15 Thetry Statement
      1. 14.15.1 SS: Early Errors
      2. 14.15.2 RS: CatchClauseEvaluation
      3. 14.15.3 RS: Evaluation
    16. +14.16 Thedebugger Statement
      1. 14.16.1 RS: Evaluation
  16. +15 ECMAScript Language: Functions and Classes
    1. +15.1 Parameter Lists
      1. 15.1.1 SS: Early Errors
      2. 15.1.2 SS: ContainsExpression
      3. 15.1.3 SS: IsSimpleParameterList
      4. 15.1.4 SS: HasInitializer
      5. 15.1.5 SS: ExpectedArgumentCount
    2. +15.2 Function Definitions
      1. 15.2.1 SS: Early Errors
      2. 15.2.2 SS: FunctionBodyContainsUseStrict
      3. 15.2.3 RS: EvaluateFunctionBody
      4. 15.2.4 RS: InstantiateOrdinaryFunctionObject
      5. 15.2.5 RS: InstantiateOrdinaryFunctionExpression
      6. 15.2.6 RS: Evaluation
    3. +15.3 Arrow Function Definitions
      1. 15.3.1 SS: Early Errors
      2. 15.3.2 SS: ConciseBodyContainsUseStrict
      3. 15.3.3 RS: EvaluateConciseBody
      4. 15.3.4 RS: InstantiateArrowFunctionExpression
      5. 15.3.5 RS: Evaluation
    4. +15.4 Method Definitions
      1. 15.4.1 SS: Early Errors
      2. 15.4.2 SS: HasDirectSuper
      3. 15.4.3 SS: SpecialMethod
      4. 15.4.4 RS: DefineMethod
      5. 15.4.5 RS: MethodDefinitionEvaluation
    5. +15.5 Generator Function Definitions
      1. 15.5.1 SS: Early Errors
      2. 15.5.2 RS: EvaluateGeneratorBody
      3. 15.5.3 RS: InstantiateGeneratorFunctionObject
      4. 15.5.4 RS: InstantiateGeneratorFunctionExpression
      5. 15.5.5 RS: Evaluation
    6. +15.6 Async Generator Function Definitions
      1. 15.6.1 SS: Early Errors
      2. 15.6.2 RS: EvaluateAsyncGeneratorBody
      3. 15.6.3 RS: InstantiateAsyncGeneratorFunctionObject
      4. 15.6.4 RS: InstantiateAsyncGeneratorFunctionExpression
      5. 15.6.5 RS: Evaluation
    7. +15.7 Class Definitions
      1. 15.7.1 SS: Early Errors
      2. 15.7.2 SS: ClassElementKind
      3. 15.7.3 SS: ConstructorMethod
      4. 15.7.4 SS: IsStatic
      5. 15.7.5 SS: NonConstructorElements
      6. 15.7.6 SS: PrototypePropertyNameList
      7. 15.7.7 SS: AllPrivateIdentifiersValid
      8. 15.7.8 SS: PrivateBoundIdentifiers
      9. 15.7.9 SS: ContainsArguments
      10. 15.7.10 RS: ClassFieldDefinitionEvaluation
      11. 15.7.11 RS: ClassStaticBlockDefinitionEvaluation
      12. 15.7.12 RS: EvaluateClassStaticBlockBody
      13. 15.7.13 RS: ClassElementEvaluation
      14. 15.7.14 RS: ClassDefinitionEvaluation
      15. 15.7.15 RS: BindingClassDeclarationEvaluation
      16. 15.7.16 RS: Evaluation
    8. +15.8 Async Function Definitions
      1. 15.8.1 SS: Early Errors
      2. 15.8.2 RS: InstantiateAsyncFunctionObject
      3. 15.8.3 RS: InstantiateAsyncFunctionExpression
      4. 15.8.4 RS: EvaluateAsyncFunctionBody
      5. 15.8.5 RS: Evaluation
    9. +15.9 Async Arrow Function Definitions
      1. 15.9.1 SS: Early Errors
      2. 15.9.2 SS: AsyncConciseBodyContainsUseStrict
      3. 15.9.3 RS: EvaluateAsyncConciseBody
      4. 15.9.4 RS: InstantiateAsyncArrowFunctionExpression
      5. 15.9.5 RS: Evaluation
    10. +15.10 Tail Position Calls
      1. 15.10.1 SS: IsInTailPosition (call )
      2. 15.10.2 SS: HasCallInTailPosition
      3. 15.10.3 PrepareForTailCall ( )
  17. +16 ECMAScript Language: Scripts and Modules
    1. +16.1 Scripts
      1. 16.1.1 SS: Early Errors
      2. 16.1.2 SS: ScriptIsStrict
      3. 16.1.3 RS: Evaluation
      4. 16.1.4 Script Records
      5. 16.1.5 ParseScript (sourceText,realm,hostDefined )
      6. 16.1.6 ScriptEvaluation (scriptRecord )
      7. 16.1.7 GlobalDeclarationInstantiation (script,env )
    2. +16.2 Modules
      1. +16.2.1 Module Semantics
        1. 16.2.1.1 SS: Early Errors
        2. 16.2.1.2 SS: ImportedLocalNames (importEntries )
        3. +16.2.1.3 ModuleRequest Records
          1. 16.2.1.3.1 ModuleRequestsEqual (left,right )
        4. 16.2.1.4 SS: ModuleRequests
        5. +16.2.1.5 Abstract Module Records
          1. 16.2.1.5.1 EvaluateModuleSync (module )
        6. +16.2.1.6 Cyclic Module Records
          1. +16.2.1.6.1 Implementation of Module Record Abstract Methods
            1. +16.2.1.6.1.1 LoadRequestedModules ( [hostDefined ] )
              1. 16.2.1.6.1.1.1 InnerModuleLoading (state,module )
              2. 16.2.1.6.1.1.2 ContinueModuleLoading (state,moduleCompletion )
            2. +16.2.1.6.1.2 Link ( )
              1. 16.2.1.6.1.2.1 InnerModuleLinking (module,stack,index )
            3. +16.2.1.6.1.3 Evaluate ( )
              1. 16.2.1.6.1.3.1 InnerModuleEvaluation (module,stack,index )
              2. 16.2.1.6.1.3.2 ExecuteAsyncModule (module )
              3. 16.2.1.6.1.3.3 GatherAvailableAncestors (module,execList )
              4. 16.2.1.6.1.3.4 AsyncModuleExecutionFulfilled (module )
              5. 16.2.1.6.1.3.5 AsyncModuleExecutionRejected (module,error )
          2. 16.2.1.6.2 Example Cyclic Module Record Graphs
        7. +16.2.1.7 Source Text Module Records
          1. 16.2.1.7.1 ParseModule (sourceText,realm,hostDefined )
          2. +16.2.1.7.2 Implementation of Module Record Abstract Methods
            1. 16.2.1.7.2.1 GetExportedNames ( [exportStarSet ] )
            2. 16.2.1.7.2.2 ResolveExport (exportName [ ,resolveSet ] )
          3. +16.2.1.7.3 Implementation of Cyclic Module Record Abstract Methods
            1. 16.2.1.7.3.1 InitializeEnvironment ( )
            2. 16.2.1.7.3.2 ExecuteModule ( [capability ] )
        8. +16.2.1.8 Synthetic Module Records
          1. 16.2.1.8.1 CreateDefaultExportSyntheticModule (defaultExport )
          2. 16.2.1.8.2 ParseJSONModule (source )
          3. 16.2.1.8.3 SetSyntheticModuleExport (module,exportName,exportValue )
          4. +16.2.1.8.4 Implementation of Module Record Abstract Methods
            1. 16.2.1.8.4.1 LoadRequestedModules ( )
            2. 16.2.1.8.4.2 GetExportedNames ( )
            3. 16.2.1.8.4.3 ResolveExport (exportName )
            4. 16.2.1.8.4.4 Link ( )
            5. 16.2.1.8.4.5 Evaluate ( )
        9. 16.2.1.9 GetImportedModule (referrer,request )
        10. 16.2.1.10 HostLoadImportedModule (referrer,moduleRequest,hostDefined,payload )
        11. 16.2.1.11 FinishLoadingImportedModule (referrer,moduleRequest,payload,result )
        12. +16.2.1.12 AllImportAttributesSupported (attributes )
          1. 16.2.1.12.1 HostGetSupportedImportAttributes ( )
        13. 16.2.1.13 GetModuleNamespace (module )
        14. 16.2.1.14 RS: Evaluation
      2. +16.2.2 Imports
        1. 16.2.2.1 SS: Early Errors
        2. 16.2.2.2 SS: ImportEntries
        3. 16.2.2.3 SS: ImportEntriesForModule
        4. 16.2.2.4 SS: WithClauseToAttributes
      3. +16.2.3 Exports
        1. 16.2.3.1 SS: Early Errors
        2. 16.2.3.2 SS: ExportedBindings
        3. 16.2.3.3 SS: ExportedNames
        4. 16.2.3.4 SS: ExportEntries
        5. 16.2.3.5 SS: ExportEntriesForModule
        6. 16.2.3.6 SS: ReferencedBindings
        7. 16.2.3.7 RS: Evaluation
  18. +17 Error Handling and Language Extensions
    1. 17.1 Forbidden Extensions
  19. 18 ECMAScript Standard Built-in Objects
  20. +19 The Global Object
    1. +19.1 Value Properties of the Global Object
      1. 19.1.1 globalThis
      2. 19.1.2 Infinity
      3. 19.1.3 NaN
      4. 19.1.4 undefined
    2. +19.2 Function Properties of the Global Object
      1. +19.2.1 eval (x )
        1. 19.2.1.1 PerformEval (x,strictCaller,direct )
        2. 19.2.1.2 HostEnsureCanCompileStrings (calleeRealm,parameterStrings,bodyString,direct )
        3. 19.2.1.3 EvalDeclarationInstantiation (body,varEnv,lexEnv,privateEnv,strict )
      2. 19.2.2 isFinite (number )
      3. 19.2.3 isNaN (number )
      4. 19.2.4 parseFloat (string )
      5. 19.2.5 parseInt (string,radix )
      6. +19.2.6 URI Handling Functions
        1. 19.2.6.1 decodeURI (encodedURI )
        2. 19.2.6.2 decodeURIComponent (encodedURIComponent )
        3. 19.2.6.3 encodeURI (uri )
        4. 19.2.6.4 encodeURIComponent (uriComponent )
        5. 19.2.6.5 Encode (string,extraUnescaped )
        6. 19.2.6.6 Decode (string,preserveEscapeSet )
        7. 19.2.6.7 ParseHexOctet (string,position )
    3. +19.3 Constructor Properties of the Global Object
      1. 19.3.1 AggregateError ( . . . )
      2. 19.3.2 Array ( . . . )
      3. 19.3.3 ArrayBuffer ( . . . )
      4. 19.3.4 BigInt ( . . . )
      5. 19.3.5 BigInt64Array ( . . . )
      6. 19.3.6 BigUint64Array ( . . . )
      7. 19.3.7 Boolean ( . . . )
      8. 19.3.8 DataView ( . . . )
      9. 19.3.9 Date ( . . . )
      10. 19.3.10 Error ( . . . )
      11. 19.3.11 EvalError ( . . . )
      12. 19.3.12 FinalizationRegistry ( . . . )
      13. 19.3.13 Float16Array ( . . . )
      14. 19.3.14 Float32Array ( . . . )
      15. 19.3.15 Float64Array ( . . . )
      16. 19.3.16 Function ( . . . )
      17. 19.3.17 Int8Array ( . . . )
      18. 19.3.18 Int16Array ( . . . )
      19. 19.3.19 Int32Array ( . . . )
      20. 19.3.20 Iterator ( . . . )
      21. 19.3.21 Map ( . . . )
      22. 19.3.22 Number ( . . . )
      23. 19.3.23 Object ( . . . )
      24. 19.3.24 Promise ( . . . )
      25. 19.3.25 Proxy ( . . . )
      26. 19.3.26 RangeError ( . . . )
      27. 19.3.27 ReferenceError ( . . . )
      28. 19.3.28 RegExp ( . . . )
      29. 19.3.29 Set ( . . . )
      30. 19.3.30 SharedArrayBuffer ( . . . )
      31. 19.3.31 String ( . . . )
      32. 19.3.32 Symbol ( . . . )
      33. 19.3.33 SyntaxError ( . . . )
      34. 19.3.34 TypeError ( . . . )
      35. 19.3.35 Uint8Array ( . . . )
      36. 19.3.36 Uint8ClampedArray ( . . . )
      37. 19.3.37 Uint16Array ( . . . )
      38. 19.3.38 Uint32Array ( . . . )
      39. 19.3.39 URIError ( . . . )
      40. 19.3.40 WeakMap ( . . . )
      41. 19.3.41 WeakRef ( . . . )
      42. 19.3.42 WeakSet ( . . . )
    4. +19.4 Other Properties of the Global Object
      1. 19.4.1 Atomics
      2. 19.4.2 JSON
      3. 19.4.3 Math
      4. 19.4.4 Reflect
  21. +20 Fundamental Objects
    1. +20.1 Object Objects
      1. +20.1.1 The Object Constructor
        1. 20.1.1.1 Object ( [value ] )
      2. +20.1.2 Properties of the Object Constructor
        1. 20.1.2.1 Object.assign (target, ...sources )
        2. 20.1.2.2 Object.create (O,Properties )
        3. +20.1.2.3 Object.defineProperties (O,Properties )
          1. 20.1.2.3.1 ObjectDefineProperties (O,Properties )
        4. 20.1.2.4 Object.defineProperty (O,P,Attributes )
        5. 20.1.2.5 Object.entries (O )
        6. 20.1.2.6 Object.freeze (O )
        7. 20.1.2.7 Object.fromEntries (iterable )
        8. 20.1.2.8 Object.getOwnPropertyDescriptor (O,P )
        9. 20.1.2.9 Object.getOwnPropertyDescriptors (O )
        10. 20.1.2.10 Object.getOwnPropertyNames (O )
        11. +20.1.2.11 Object.getOwnPropertySymbols (O )
          1. 20.1.2.11.1 GetOwnPropertyKeys (O,type )
        12. 20.1.2.12 Object.getPrototypeOf (O )
        13. 20.1.2.13 Object.groupBy (items,callback )
        14. 20.1.2.14 Object.hasOwn (O,P )
        15. 20.1.2.15 Object.is (value1,value2 )
        16. 20.1.2.16 Object.isExtensible (O )
        17. 20.1.2.17 Object.isFrozen (O )
        18. 20.1.2.18 Object.isSealed (O )
        19. 20.1.2.19 Object.keys (O )
        20. 20.1.2.20 Object.preventExtensions (O )
        21. 20.1.2.21 Object.prototype
        22. 20.1.2.22 Object.seal (O )
        23. 20.1.2.23 Object.setPrototypeOf (O,proto )
        24. 20.1.2.24 Object.values (O )
      3. +20.1.3 Properties of the Object Prototype Object
        1. 20.1.3.1 Object.prototype.constructor
        2. 20.1.3.2 Object.prototype.hasOwnProperty (V )
        3. 20.1.3.3 Object.prototype.isPrototypeOf (V )
        4. 20.1.3.4 Object.prototype.propertyIsEnumerable (V )
        5. 20.1.3.5 Object.prototype.toLocaleString ( [reserved1 [ ,reserved2 ] ] )
        6. 20.1.3.6 Object.prototype.toString ( )
        7. 20.1.3.7 Object.prototype.valueOf ( )
        8. +20.1.3.8 Object.prototype.__proto__
          1. 20.1.3.8.1 get Object.prototype.__proto__
          2. 20.1.3.8.2 set Object.prototype.__proto__
        9. +20.1.3.9 Legacy Object.prototype Accessor Methods
          1. 20.1.3.9.1 Object.prototype.__defineGetter__ (P,getter )
          2. 20.1.3.9.2 Object.prototype.__defineSetter__ (P,setter )
          3. 20.1.3.9.3 Object.prototype.__lookupGetter__ (P )
          4. 20.1.3.9.4 Object.prototype.__lookupSetter__ (P )
      4. 20.1.4 Properties of Object Instances
    2. +20.2 Function Objects
      1. +20.2.1 The Function Constructor
        1. +20.2.1.1 Function ( ...parameterArgs,bodyArg )
          1. 20.2.1.1.1 CreateDynamicFunction (constructor,newTarget,kind,parameterArgs,bodyArg )
      2. +20.2.2 Properties of the Function Constructor
        1. 20.2.2.1 Function.prototype
      3. +20.2.3 Properties of the Function Prototype Object
        1. 20.2.3.1 Function.prototype.apply (thisArg,argArray )
        2. 20.2.3.2 Function.prototype.bind (thisArg, ...args )
        3. 20.2.3.3 Function.prototype.call (thisArg, ...args )
        4. 20.2.3.4 Function.prototype.constructor
        5. 20.2.3.5 Function.prototype.toString ( )
        6. 20.2.3.6 Function.prototype [ %Symbol.hasInstance% ] (V )
      4. +20.2.4 Function Instances
        1. 20.2.4.1 length
        2. 20.2.4.2 name
        3. 20.2.4.3 prototype
      5. 20.2.5 HostHasSourceTextAvailable (func )
    3. +20.3 Boolean Objects
      1. +20.3.1 The Boolean Constructor
        1. 20.3.1.1 Boolean (value )
      2. +20.3.2 Properties of the Boolean Constructor
        1. 20.3.2.1 Boolean.prototype
      3. +20.3.3 Properties of the Boolean Prototype Object
        1. 20.3.3.1 Boolean.prototype.constructor
        2. 20.3.3.2 Boolean.prototype.toString ( )
        3. +20.3.3.3 Boolean.prototype.valueOf ( )
          1. 20.3.3.3.1 ThisBooleanValue (value )
      4. 20.3.4 Properties of Boolean Instances
    4. +20.4 Symbol Objects
      1. +20.4.1 The Symbol Constructor
        1. 20.4.1.1 Symbol ( [description ] )
      2. +20.4.2 Properties of the Symbol Constructor
        1. 20.4.2.1 Symbol.asyncIterator
        2. 20.4.2.2 Symbol.for (key )
        3. 20.4.2.3 Symbol.hasInstance
        4. 20.4.2.4 Symbol.isConcatSpreadable
        5. 20.4.2.5 Symbol.iterator
        6. 20.4.2.6 Symbol.keyFor (sym )
        7. 20.4.2.7 Symbol.match
        8. 20.4.2.8 Symbol.matchAll
        9. 20.4.2.9 Symbol.prototype
        10. 20.4.2.10 Symbol.replace
        11. 20.4.2.11 Symbol.search
        12. 20.4.2.12 Symbol.species
        13. 20.4.2.13 Symbol.split
        14. 20.4.2.14 Symbol.toPrimitive
        15. 20.4.2.15 Symbol.toStringTag
        16. 20.4.2.16 Symbol.unscopables
      3. +20.4.3 Properties of the Symbol Prototype Object
        1. 20.4.3.1 Symbol.prototype.constructor
        2. 20.4.3.2 get Symbol.prototype.description
        3. +20.4.3.3 Symbol.prototype.toString ( )
          1. 20.4.3.3.1 SymbolDescriptiveString (sym )
        4. +20.4.3.4 Symbol.prototype.valueOf ( )
          1. 20.4.3.4.1 ThisSymbolValue (value )
        5. 20.4.3.5 Symbol.prototype [ %Symbol.toPrimitive% ] (hint )
        6. 20.4.3.6 Symbol.prototype [ %Symbol.toStringTag% ]
      4. 20.4.4 Properties of Symbol Instances
      5. +20.4.5 Abstract Operations for Symbols
        1. 20.4.5.1 KeyForSymbol (sym )
    5. +20.5 Error Objects
      1. +20.5.1 The Error Constructor
        1. 20.5.1.1 Error (message [ ,options ] )
      2. +20.5.2 Properties of the Error Constructor
        1. 20.5.2.1 Error.isError (arg )
        2. 20.5.2.2 Error.prototype
      3. +20.5.3 Properties of the Error Prototype Object
        1. 20.5.3.1 Error.prototype.constructor
        2. 20.5.3.2 Error.prototype.message
        3. 20.5.3.3 Error.prototype.name
        4. 20.5.3.4 Error.prototype.toString ( )
      4. 20.5.4 Properties of Error Instances
      5. +20.5.5 Native Error Types Used in This Standard
        1. 20.5.5.1 EvalError
        2. 20.5.5.2 RangeError
        3. 20.5.5.3 ReferenceError
        4. 20.5.5.4 SyntaxError
        5. 20.5.5.5 TypeError
        6. 20.5.5.6 URIError
      6. +20.5.6NativeError Object Structure
        1. +20.5.6.1 TheNativeError Constructors
          1. 20.5.6.1.1NativeError (message [ ,options ] )
        2. +20.5.6.2 Properties of theNativeError Constructors
          1. 20.5.6.2.1NativeError.prototype
        3. +20.5.6.3 Properties of theNativeError Prototype Objects
          1. 20.5.6.3.1NativeError.prototype.constructor
          2. 20.5.6.3.2NativeError.prototype.message
          3. 20.5.6.3.3NativeError.prototype.name
        4. 20.5.6.4 Properties ofNativeError Instances
      7. +20.5.7 AggregateError Objects
        1. +20.5.7.1 The AggregateError Constructor
          1. 20.5.7.1.1 AggregateError (errors,message [ ,options ] )
        2. +20.5.7.2 Properties of the AggregateError Constructor
          1. 20.5.7.2.1 AggregateError.prototype
        3. +20.5.7.3 Properties of the AggregateError Prototype Object
          1. 20.5.7.3.1 AggregateError.prototype.constructor
          2. 20.5.7.3.2 AggregateError.prototype.message
          3. 20.5.7.3.3 AggregateError.prototype.name
        4. 20.5.7.4 Properties of AggregateError Instances
      8. +20.5.8 Abstract Operations for Error Objects
        1. 20.5.8.1 InstallErrorCause (O,options )
  22. +21 Numbers and Dates
    1. +21.1 Number Objects
      1. +21.1.1 The Number Constructor
        1. 21.1.1.1 Number (value )
      2. +21.1.2 Properties of the Number Constructor
        1. 21.1.2.1 Number.EPSILON
        2. 21.1.2.2 Number.isFinite (number )
        3. 21.1.2.3 Number.isInteger (number )
        4. 21.1.2.4 Number.isNaN (number )
        5. 21.1.2.5 Number.isSafeInteger (number )
        6. 21.1.2.6 Number.MAX_SAFE_INTEGER
        7. 21.1.2.7 Number.MAX_VALUE
        8. 21.1.2.8 Number.MIN_SAFE_INTEGER
        9. 21.1.2.9 Number.MIN_VALUE
        10. 21.1.2.10 Number.NaN
        11. 21.1.2.11 Number.NEGATIVE_INFINITY
        12. 21.1.2.12 Number.parseFloat (string )
        13. 21.1.2.13 Number.parseInt (string,radix )
        14. 21.1.2.14 Number.POSITIVE_INFINITY
        15. 21.1.2.15 Number.prototype
      3. +21.1.3 Properties of the Number Prototype Object
        1. 21.1.3.1 Number.prototype.constructor
        2. 21.1.3.2 Number.prototype.toExponential (fractionDigits )
        3. 21.1.3.3 Number.prototype.toFixed (fractionDigits )
        4. 21.1.3.4 Number.prototype.toLocaleString ( [reserved1 [ ,reserved2 ] ] )
        5. 21.1.3.5 Number.prototype.toPrecision (precision )
        6. 21.1.3.6 Number.prototype.toString ( [radix ] )
        7. +21.1.3.7 Number.prototype.valueOf ( )
          1. 21.1.3.7.1 ThisNumberValue (value )
      4. 21.1.4 Properties of Number Instances
    2. +21.2 BigInt Objects
      1. +21.2.1 The BigInt Constructor
        1. +21.2.1.1 BigInt (value )
          1. 21.2.1.1.1 NumberToBigInt (number )
      2. +21.2.2 Properties of the BigInt Constructor
        1. 21.2.2.1 BigInt.asIntN (bits,bigint )
        2. 21.2.2.2 BigInt.asUintN (bits,bigint )
        3. 21.2.2.3 BigInt.prototype
      3. +21.2.3 Properties of the BigInt Prototype Object
        1. 21.2.3.1 BigInt.prototype.constructor
        2. 21.2.3.2 BigInt.prototype.toLocaleString ( [reserved1 [ ,reserved2 ] ] )
        3. 21.2.3.3 BigInt.prototype.toString ( [radix ] )
        4. +21.2.3.4 BigInt.prototype.valueOf ( )
          1. 21.2.3.4.1 ThisBigIntValue (value )
        5. 21.2.3.5 BigInt.prototype [ %Symbol.toStringTag% ]
      4. 21.2.4 Properties of BigInt Instances
    3. +21.3 The Math Object
      1. +21.3.1 Value Properties of the Math Object
        1. 21.3.1.1 Math.E
        2. 21.3.1.2 Math.LN10
        3. 21.3.1.3 Math.LN2
        4. 21.3.1.4 Math.LOG10E
        5. 21.3.1.5 Math.LOG2E
        6. 21.3.1.6 Math.PI
        7. 21.3.1.7 Math.SQRT1_2
        8. 21.3.1.8 Math.SQRT2
        9. 21.3.1.9 Math [ %Symbol.toStringTag% ]
      2. +21.3.2 Function Properties of the Math Object
        1. 21.3.2.1 Math.abs (x )
        2. 21.3.2.2 Math.acos (x )
        3. 21.3.2.3 Math.acosh (x )
        4. 21.3.2.4 Math.asin (x )
        5. 21.3.2.5 Math.asinh (x )
        6. 21.3.2.6 Math.atan (x )
        7. 21.3.2.7 Math.atanh (x )
        8. 21.3.2.8 Math.atan2 (y,x )
        9. 21.3.2.9 Math.cbrt (x )
        10. 21.3.2.10 Math.ceil (x )
        11. 21.3.2.11 Math.clz32 (x )
        12. 21.3.2.12 Math.cos (x )
        13. 21.3.2.13 Math.cosh (x )
        14. 21.3.2.14 Math.exp (x )
        15. 21.3.2.15 Math.expm1 (x )
        16. 21.3.2.16 Math.floor (x )
        17. 21.3.2.17 Math.fround (x )
        18. 21.3.2.18 Math.f16round (x )
        19. 21.3.2.19 Math.hypot ( ...args )
        20. 21.3.2.20 Math.imul (x,y )
        21. 21.3.2.21 Math.log (x )
        22. 21.3.2.22 Math.log1p (x )
        23. 21.3.2.23 Math.log10 (x )
        24. 21.3.2.24 Math.log2 (x )
        25. 21.3.2.25 Math.max ( ...args )
        26. 21.3.2.26 Math.min ( ...args )
        27. 21.3.2.27 Math.pow (base,exponent )
        28. 21.3.2.28 Math.random ( )
        29. 21.3.2.29 Math.round (x )
        30. 21.3.2.30 Math.sign (x )
        31. 21.3.2.31 Math.sin (x )
        32. 21.3.2.32 Math.sinh (x )
        33. 21.3.2.33 Math.sqrt (x )
        34. 21.3.2.34 Math.sumPrecise (items )
        35. 21.3.2.35 Math.tan (x )
        36. 21.3.2.36 Math.tanh (x )
        37. 21.3.2.37 Math.trunc (x )
    4. +21.4 Date Objects
      1. +21.4.1 Overview of Date Objects and Definitions of Abstract Operations
        1. 21.4.1.1 Time Values and Time Range
        2. 21.4.1.2 Time-related Constants
        3. 21.4.1.3 Day (t )
        4. 21.4.1.4 TimeWithinDay (t )
        5. 21.4.1.5 DaysInYear (y )
        6. 21.4.1.6 DayFromYear (y )
        7. 21.4.1.7 TimeFromYear (y )
        8. 21.4.1.8 YearFromTime (t )
        9. 21.4.1.9 DayWithinYear (t )
        10. 21.4.1.10 InLeapYear (t )
        11. 21.4.1.11 MonthFromTime (t )
        12. 21.4.1.12 DateFromTime (t )
        13. 21.4.1.13 WeekDay (t )
        14. 21.4.1.14 HourFromTime (t )
        15. 21.4.1.15 MinFromTime (t )
        16. 21.4.1.16 SecFromTime (t )
        17. 21.4.1.17 msFromTime (t )
        18. 21.4.1.18 GetUTCEpochNanoseconds (year,month,day,hour,minute,second,millisecond,microsecond,nanosecond )
        19. 21.4.1.19 Time Zone Identifiers
        20. 21.4.1.20 GetNamedTimeZoneEpochNanoseconds (timeZoneIdentifier,year,month,day,hour,minute,second,millisecond,microsecond,nanosecond )
        21. 21.4.1.21 GetNamedTimeZoneOffsetNanoseconds (timeZoneIdentifier,epochNanoseconds )
        22. 21.4.1.22 Time Zone Identifier Record
        23. 21.4.1.23 AvailableNamedTimeZoneIdentifiers ( )
        24. 21.4.1.24 SystemTimeZoneIdentifier ( )
        25. 21.4.1.25 LocalTime (t )
        26. 21.4.1.26 UTC (t )
        27. 21.4.1.27 MakeTime (hour,min,sec,ms )
        28. 21.4.1.28 MakeDay (year,month,date )
        29. 21.4.1.29 MakeDate (day,time )
        30. 21.4.1.30 MakeFullYear (year )
        31. 21.4.1.31 TimeClip (time )
        32. +21.4.1.32 Date Time String Format
          1. 21.4.1.32.1 Expanded Years
        33. +21.4.1.33 Time Zone Offset String Format
          1. 21.4.1.33.1 IsTimeZoneOffsetString (offsetString )
          2. 21.4.1.33.2 ParseTimeZoneOffsetString (offsetString )
      2. +21.4.2 The Date Constructor
        1. 21.4.2.1 Date ( ...values )
      3. +21.4.3 Properties of the Date Constructor
        1. 21.4.3.1 Date.now ( )
        2. 21.4.3.2 Date.parse (string )
        3. 21.4.3.3 Date.prototype
        4. 21.4.3.4 Date.UTC (year [ ,month [ ,date [ ,hours [ ,minutes [ ,seconds [ ,ms ] ] ] ] ] ] )
      4. +21.4.4 Properties of the Date Prototype Object
        1. 21.4.4.1 Date.prototype.constructor
        2. 21.4.4.2 Date.prototype.getDate ( )
        3. 21.4.4.3 Date.prototype.getDay ( )
        4. 21.4.4.4 Date.prototype.getFullYear ( )
        5. 21.4.4.5 Date.prototype.getHours ( )
        6. 21.4.4.6 Date.prototype.getMilliseconds ( )
        7. 21.4.4.7 Date.prototype.getMinutes ( )
        8. 21.4.4.8 Date.prototype.getMonth ( )
        9. 21.4.4.9 Date.prototype.getSeconds ( )
        10. 21.4.4.10 Date.prototype.getTime ( )
        11. 21.4.4.11 Date.prototype.getTimezoneOffset ( )
        12. 21.4.4.12 Date.prototype.getUTCDate ( )
        13. 21.4.4.13 Date.prototype.getUTCDay ( )
        14. 21.4.4.14 Date.prototype.getUTCFullYear ( )
        15. 21.4.4.15 Date.prototype.getUTCHours ( )
        16. 21.4.4.16 Date.prototype.getUTCMilliseconds ( )
        17. 21.4.4.17 Date.prototype.getUTCMinutes ( )
        18. 21.4.4.18 Date.prototype.getUTCMonth ( )
        19. 21.4.4.19 Date.prototype.getUTCSeconds ( )
        20. 21.4.4.20 Date.prototype.setDate (date )
        21. 21.4.4.21 Date.prototype.setFullYear (year [ ,month [ ,date ] ] )
        22. 21.4.4.22 Date.prototype.setHours (hour [ ,min [ ,sec [ ,ms ] ] ] )
        23. 21.4.4.23 Date.prototype.setMilliseconds (ms )
        24. 21.4.4.24 Date.prototype.setMinutes (min [ ,sec [ ,ms ] ] )
        25. 21.4.4.25 Date.prototype.setMonth (month [ ,date ] )
        26. 21.4.4.26 Date.prototype.setSeconds (sec [ ,ms ] )
        27. 21.4.4.27 Date.prototype.setTime (time )
        28. 21.4.4.28 Date.prototype.setUTCDate (date )
        29. 21.4.4.29 Date.prototype.setUTCFullYear (year [ ,month [ ,date ] ] )
        30. 21.4.4.30 Date.prototype.setUTCHours (hour [ ,min [ ,sec [ ,ms ] ] ] )
        31. 21.4.4.31 Date.prototype.setUTCMilliseconds (ms )
        32. 21.4.4.32 Date.prototype.setUTCMinutes (min [ ,sec [ ,ms ] ] )
        33. 21.4.4.33 Date.prototype.setUTCMonth (month [ ,date ] )
        34. 21.4.4.34 Date.prototype.setUTCSeconds (sec [ ,ms ] )
        35. 21.4.4.35 Date.prototype.toDateString ( )
        36. 21.4.4.36 Date.prototype.toISOString ( )
        37. 21.4.4.37 Date.prototype.toJSON (key )
        38. 21.4.4.38 Date.prototype.toLocaleDateString ( [reserved1 [ ,reserved2 ] ] )
        39. 21.4.4.39 Date.prototype.toLocaleString ( [reserved1 [ ,reserved2 ] ] )
        40. 21.4.4.40 Date.prototype.toLocaleTimeString ( [reserved1 [ ,reserved2 ] ] )
        41. +21.4.4.41 Date.prototype.toString ( )
          1. 21.4.4.41.1 TimeString (tv )
          2. 21.4.4.41.2 DateString (tv )
          3. 21.4.4.41.3 TimeZoneString (tv )
          4. 21.4.4.41.4 ToDateString (tv )
        42. 21.4.4.42 Date.prototype.toTimeString ( )
        43. 21.4.4.43 Date.prototype.toUTCString ( )
        44. 21.4.4.44 Date.prototype.valueOf ( )
        45. 21.4.4.45 Date.prototype [ %Symbol.toPrimitive% ] (hint )
      5. 21.4.5 Properties of Date Instances
  23. +22 Text Processing
    1. +22.1 String Objects
      1. +22.1.1 The String Constructor
        1. 22.1.1.1 String (value )
      2. +22.1.2 Properties of the String Constructor
        1. 22.1.2.1 String.fromCharCode ( ...codeUnits )
        2. 22.1.2.2 String.fromCodePoint ( ...codePoints )
        3. 22.1.2.3 String.prototype
        4. 22.1.2.4 String.raw (template, ...substitutions )
      3. +22.1.3 Properties of the String Prototype Object
        1. 22.1.3.1 String.prototype.at (index )
        2. 22.1.3.2 String.prototype.charAt (pos )
        3. 22.1.3.3 String.prototype.charCodeAt (pos )
        4. 22.1.3.4 String.prototype.codePointAt (pos )
        5. 22.1.3.5 String.prototype.concat ( ...args )
        6. 22.1.3.6 String.prototype.constructor
        7. 22.1.3.7 String.prototype.endsWith (searchString [ ,endPosition ] )
        8. 22.1.3.8 String.prototype.includes (searchString [ ,position ] )
        9. 22.1.3.9 String.prototype.indexOf (searchString [ ,position ] )
        10. 22.1.3.10 String.prototype.isWellFormed ( )
        11. 22.1.3.11 String.prototype.lastIndexOf (searchString [ ,position ] )
        12. 22.1.3.12 String.prototype.localeCompare (that [ ,reserved1 [ ,reserved2 ] ] )
        13. 22.1.3.13 String.prototype.match (regexp )
        14. 22.1.3.14 String.prototype.matchAll (regexp )
        15. 22.1.3.15 String.prototype.normalize ( [form ] )
        16. 22.1.3.16 String.prototype.padEnd (maxLength [ ,fillString ] )
        17. +22.1.3.17 String.prototype.padStart (maxLength [ ,fillString ] )
          1. 22.1.3.17.1 StringPaddingBuiltinsImpl (O,maxLength,fillString,placement )
          2. 22.1.3.17.2 StringPad (S,maxLength,fillString,placement )
          3. 22.1.3.17.3 ToZeroPaddedDecimalString (n,minLength )
        18. 22.1.3.18 String.prototype.repeat (count )
        19. +22.1.3.19 String.prototype.replace (searchValue,replaceValue )
          1. 22.1.3.19.1 GetSubstitution (matched,str,position,captures,namedCaptures,replacementTemplate )
        20. 22.1.3.20 String.prototype.replaceAll (searchValue,replaceValue )
        21. 22.1.3.21 String.prototype.search (regexp )
        22. 22.1.3.22 String.prototype.slice (start,end )
        23. 22.1.3.23 String.prototype.split (separator,limit )
        24. 22.1.3.24 String.prototype.startsWith (searchString [ ,position ] )
        25. 22.1.3.25 String.prototype.substring (start,end )
        26. 22.1.3.26 String.prototype.toLocaleLowerCase ( [reserved1 [ ,reserved2 ] ] )
        27. 22.1.3.27 String.prototype.toLocaleUpperCase ( [reserved1 [ ,reserved2 ] ] )
        28. 22.1.3.28 String.prototype.toLowerCase ( )
        29. 22.1.3.29 String.prototype.toString ( )
        30. 22.1.3.30 String.prototype.toUpperCase ( )
        31. 22.1.3.31 String.prototype.toWellFormed ( )
        32. +22.1.3.32 String.prototype.trim ( )
          1. 22.1.3.32.1 TrimString (string,where )
        33. 22.1.3.33 String.prototype.trimEnd ( )
        34. 22.1.3.34 String.prototype.trimStart ( )
        35. +22.1.3.35 String.prototype.valueOf ( )
          1. 22.1.3.35.1 ThisStringValue (value )
        36. 22.1.3.36 String.prototype [ %Symbol.iterator% ] ( )
      4. +22.1.4 Properties of String Instances
        1. 22.1.4.1 length
      5. +22.1.5 String Iterator Objects
        1. +22.1.5.1 The %StringIteratorPrototype% Object
          1. 22.1.5.1.1 %StringIteratorPrototype%.next ( )
          2. 22.1.5.1.2 %StringIteratorPrototype% [ %Symbol.toStringTag% ]
    2. +22.2 RegExp (Regular Expression) Objects
      1. +22.2.1 Patterns
        1. 22.2.1.1 SS: Early Errors
        2. 22.2.1.2 SS: CountLeftCapturingParensWithin (node )
        3. 22.2.1.3 SS: CountLeftCapturingParensBefore (node )
        4. 22.2.1.4 SS: MightBothParticipate (x,y )
        5. 22.2.1.5 SS: CapturingGroupNumber
        6. 22.2.1.6 SS: IsCharacterClass
        7. 22.2.1.7 SS: CharacterValue
        8. 22.2.1.8 SS: MayContainStrings
        9. 22.2.1.9 SS: GroupSpecifiersThatMatch (thisGroupName )
        10. 22.2.1.10 SS: CapturingGroupName
        11. 22.2.1.11 SS: RegExpIdentifierCodePoints
        12. 22.2.1.12 SS: RegExpIdentifierCodePoint
      2. +22.2.2 Pattern Semantics
        1. +22.2.2.1 Notation
          1. 22.2.2.1.1 RegExp Records
        2. 22.2.2.2 RS: CompilePattern
        3. +22.2.2.3 RS: CompileSubpattern
          1. 22.2.2.3.1 RepeatMatcher (m,min,max,greedy,x,c,parenIndex,parenCount )
          2. 22.2.2.3.2 EmptyMatcher ( )
          3. 22.2.2.3.3 MatchTwoAlternatives (m1,m2 )
          4. 22.2.2.3.4 MatchSequence (m1,m2,direction )
        4. +22.2.2.4 RS: CompileAssertion
          1. 22.2.2.4.1 IsWordChar (rer,Input,e )
        5. 22.2.2.5 RS: CompileQuantifier
        6. 22.2.2.6 RS: CompileQuantifierPrefix
        7. +22.2.2.7 RS: CompileAtom
          1. 22.2.2.7.1 CharacterSetMatcher (rer,A,invert,direction )
          2. 22.2.2.7.2 BackreferenceMatcher (rer,ns,direction )
          3. 22.2.2.7.3 Canonicalize (rer,ch )
          4. 22.2.2.7.4 UpdateModifiers (rer,add,remove )
        8. 22.2.2.8 RS: CompileCharacterClass
        9. +22.2.2.9 RS: CompileToCharSet
          1. 22.2.2.9.1 CharacterRange (A,B )
          2. 22.2.2.9.2 HasEitherUnicodeFlag (rer )
          3. 22.2.2.9.3 WordCharacters (rer )
          4. 22.2.2.9.4 AllCharacters (rer )
          5. 22.2.2.9.5 MaybeSimpleCaseFolding (rer,A )
          6. 22.2.2.9.6 CharacterComplement (rer,S )
          7. 22.2.2.9.7 UnicodeMatchProperty (rer,p )
          8. 22.2.2.9.8 UnicodeMatchPropertyValue (p,v )
        10. 22.2.2.10 RS: CompileClassSetString
      3. +22.2.3 Abstract Operations for RegExp Creation
        1. 22.2.3.1 RegExpCreate (P,F )
        2. 22.2.3.2 RegExpAlloc (newTarget )
        3. 22.2.3.3 RegExpInitialize (obj,pattern,flags )
        4. 22.2.3.4 SS: ParsePattern (patternText,u,v )
      4. +22.2.4 The RegExp Constructor
        1. 22.2.4.1 RegExp (pattern,flags )
      5. +22.2.5 Properties of the RegExp Constructor
        1. +22.2.5.1 RegExp.escape (S )
          1. 22.2.5.1.1 EncodeForRegExpEscape (cp )
        2. 22.2.5.2 RegExp.prototype
        3. 22.2.5.3 get RegExp [ %Symbol.species% ]
      6. +22.2.6 Properties of the RegExp Prototype Object
        1. 22.2.6.1 RegExp.prototype.constructor
        2. 22.2.6.2 RegExp.prototype.exec (string )
        3. 22.2.6.3 get RegExp.prototype.dotAll
        4. +22.2.6.4 get RegExp.prototype.flags
          1. 22.2.6.4.1 RegExpHasFlag (R,codeUnit )
        5. 22.2.6.5 get RegExp.prototype.global
        6. 22.2.6.6 get RegExp.prototype.hasIndices
        7. 22.2.6.7 get RegExp.prototype.ignoreCase
        8. 22.2.6.8 RegExp.prototype [ %Symbol.match% ] (string )
        9. 22.2.6.9 RegExp.prototype [ %Symbol.matchAll% ] (string )
        10. 22.2.6.10 get RegExp.prototype.multiline
        11. 22.2.6.11 RegExp.prototype [ %Symbol.replace% ] (string,replaceValue )
        12. 22.2.6.12 RegExp.prototype [ %Symbol.search% ] (string )
        13. +22.2.6.13 get RegExp.prototype.source
          1. 22.2.6.13.1 EscapeRegExpPattern (P,F )
        14. 22.2.6.14 RegExp.prototype [ %Symbol.split% ] (string,limit )
        15. 22.2.6.15 get RegExp.prototype.sticky
        16. 22.2.6.16 RegExp.prototype.test (S )
        17. 22.2.6.17 RegExp.prototype.toString ( )
        18. 22.2.6.18 get RegExp.prototype.unicode
        19. 22.2.6.19 get RegExp.prototype.unicodeSets
      7. +22.2.7 Abstract Operations for RegExp Matching
        1. 22.2.7.1 RegExpExec (R,S )
        2. 22.2.7.2 RegExpBuiltinExec (R,S )
        3. 22.2.7.3 AdvanceStringIndex (S,index,unicode )
        4. 22.2.7.4 GetStringIndex (S,codePointIndex )
        5. 22.2.7.5 Match Records
        6. 22.2.7.6 GetMatchString (S,match )
        7. 22.2.7.7 GetMatchIndexPair (S,match )
        8. 22.2.7.8 MakeMatchIndicesIndexPairArray (S,indices,groupNames,hasGroups )
      8. +22.2.8 Properties of RegExp Instances
        1. 22.2.8.1 lastIndex
      9. +22.2.9 RegExp String Iterator Objects
        1. 22.2.9.1 CreateRegExpStringIterator (R,S,global,fullUnicode )
        2. +22.2.9.2 The %RegExpStringIteratorPrototype% Object
          1. 22.2.9.2.1 %RegExpStringIteratorPrototype%.next ( )
          2. 22.2.9.2.2 %RegExpStringIteratorPrototype% [ %Symbol.toStringTag% ]
        3. 22.2.9.3 Properties of RegExp String Iterator Instances
  24. +23 Indexed Collections
    1. +23.1 Array Objects
      1. +23.1.1 The Array Constructor
        1. 23.1.1.1 Array ( ...values )
      2. +23.1.2 Properties of the Array Constructor
        1. 23.1.2.1 Array.from (items [ ,mapper [ ,thisArg ] ] )
        2. 23.1.2.2 Array.isArray (arg )
        3. 23.1.2.3 Array.of ( ...items )
        4. 23.1.2.4 Array.prototype
        5. 23.1.2.5 get Array [ %Symbol.species% ]
      3. +23.1.3 Properties of the Array Prototype Object
        1. 23.1.3.1 Array.prototype.at (index )
        2. +23.1.3.2 Array.prototype.concat ( ...items )
          1. 23.1.3.2.1 IsConcatSpreadable (O )
        3. 23.1.3.3 Array.prototype.constructor
        4. 23.1.3.4 Array.prototype.copyWithin (target,start [ ,end ] )
        5. 23.1.3.5 Array.prototype.entries ( )
        6. 23.1.3.6 Array.prototype.every (callback [ ,thisArg ] )
        7. 23.1.3.7 Array.prototype.fill (value [ ,start [ ,end ] ] )
        8. 23.1.3.8 Array.prototype.filter (callback [ ,thisArg ] )
        9. 23.1.3.9 Array.prototype.find (predicate [ ,thisArg ] )
        10. 23.1.3.10 Array.prototype.findIndex (predicate [ ,thisArg ] )
        11. 23.1.3.11 Array.prototype.findLast (predicate [ ,thisArg ] )
        12. +23.1.3.12 Array.prototype.findLastIndex (predicate [ ,thisArg ] )
          1. 23.1.3.12.1 FindViaPredicate (O,len,direction,predicate,thisArg )
        13. +23.1.3.13 Array.prototype.flat ( [depth ] )
          1. 23.1.3.13.1 FlattenIntoArray (target,source,sourceLen,start,depth [ ,mapperFunction [ ,thisArg ] ] )
        14. 23.1.3.14 Array.prototype.flatMap (mapperFunction [ ,thisArg ] )
        15. 23.1.3.15 Array.prototype.forEach (callback [ ,thisArg ] )
        16. 23.1.3.16 Array.prototype.includes (searchElement [ ,fromIndex ] )
        17. 23.1.3.17 Array.prototype.indexOf (searchElement [ ,fromIndex ] )
        18. 23.1.3.18 Array.prototype.join (separator )
        19. 23.1.3.19 Array.prototype.keys ( )
        20. 23.1.3.20 Array.prototype.lastIndexOf (searchElement [ ,fromIndex ] )
        21. 23.1.3.21 Array.prototype.map (callback [ ,thisArg ] )
        22. 23.1.3.22 Array.prototype.pop ( )
        23. 23.1.3.23 Array.prototype.push ( ...items )
        24. 23.1.3.24 Array.prototype.reduce (callback [ ,initialValue ] )
        25. 23.1.3.25 Array.prototype.reduceRight (callback [ ,initialValue ] )
        26. 23.1.3.26 Array.prototype.reverse ( )
        27. 23.1.3.27 Array.prototype.shift ( )
        28. 23.1.3.28 Array.prototype.slice (start,end )
        29. 23.1.3.29 Array.prototype.some (callback [ ,thisArg ] )
        30. +23.1.3.30 Array.prototype.sort (comparator )
          1. 23.1.3.30.1 SortIndexedProperties (obj,len,SortCompare,holes )
          2. 23.1.3.30.2 CompareArrayElements (x,y,comparator )
        31. 23.1.3.31 Array.prototype.splice (start,deleteCount, ...items )
        32. 23.1.3.32 Array.prototype.toLocaleString ( [reserved1 [ ,reserved2 ] ] )
        33. 23.1.3.33 Array.prototype.toReversed ( )
        34. 23.1.3.34 Array.prototype.toSorted (comparator )
        35. 23.1.3.35 Array.prototype.toSpliced (start,skipCount, ...items )
        36. 23.1.3.36 Array.prototype.toString ( )
        37. 23.1.3.37 Array.prototype.unshift ( ...items )
        38. 23.1.3.38 Array.prototype.values ( )
        39. 23.1.3.39 Array.prototype.with (index,value )
        40. 23.1.3.40 Array.prototype [ %Symbol.iterator% ] ( )
        41. 23.1.3.41 Array.prototype [ %Symbol.unscopables% ]
      4. +23.1.4 Properties of Array Instances
        1. 23.1.4.1 length
      5. +23.1.5 Array Iterator Objects
        1. 23.1.5.1 CreateArrayIterator (array,kind )
        2. +23.1.5.2 The %ArrayIteratorPrototype% Object
          1. 23.1.5.2.1 %ArrayIteratorPrototype%.next ( )
          2. 23.1.5.2.2 %ArrayIteratorPrototype% [ %Symbol.toStringTag% ]
        3. 23.1.5.3 Properties of Array Iterator Instances
    2. +23.2 TypedArray Objects
      1. +23.2.1 The %TypedArray% Intrinsic Object
        1. 23.2.1.1 %TypedArray% ( )
      2. +23.2.2 Properties of the %TypedArray% Intrinsic Object
        1. 23.2.2.1 %TypedArray%.from (source [ ,mapper [ ,thisArg ] ] )
        2. 23.2.2.2 %TypedArray%.of ( ...items )
        3. 23.2.2.3 %TypedArray%.prototype
        4. 23.2.2.4 get %TypedArray% [ %Symbol.species% ]
      3. +23.2.3 Properties of the %TypedArray% Prototype Object
        1. 23.2.3.1 %TypedArray%.prototype.at (index )
        2. 23.2.3.2 get %TypedArray%.prototype.buffer
        3. 23.2.3.3 get %TypedArray%.prototype.byteLength
        4. 23.2.3.4 get %TypedArray%.prototype.byteOffset
        5. 23.2.3.5 %TypedArray%.prototype.constructor
        6. 23.2.3.6 %TypedArray%.prototype.copyWithin (target,start [ ,end ] )
        7. 23.2.3.7 %TypedArray%.prototype.entries ( )
        8. 23.2.3.8 %TypedArray%.prototype.every (callback [ ,thisArg ] )
        9. 23.2.3.9 %TypedArray%.prototype.fill (value [ ,start [ ,end ] ] )
        10. 23.2.3.10 %TypedArray%.prototype.filter (callback [ ,thisArg ] )
        11. 23.2.3.11 %TypedArray%.prototype.find (predicate [ ,thisArg ] )
        12. 23.2.3.12 %TypedArray%.prototype.findIndex (predicate [ ,thisArg ] )
        13. 23.2.3.13 %TypedArray%.prototype.findLast (predicate [ ,thisArg ] )
        14. 23.2.3.14 %TypedArray%.prototype.findLastIndex (predicate [ ,thisArg ] )
        15. 23.2.3.15 %TypedArray%.prototype.forEach (callback [ ,thisArg ] )
        16. 23.2.3.16 %TypedArray%.prototype.includes (searchElement [ ,fromIndex ] )
        17. 23.2.3.17 %TypedArray%.prototype.indexOf (searchElement [ ,fromIndex ] )
        18. 23.2.3.18 %TypedArray%.prototype.join (separator )
        19. 23.2.3.19 %TypedArray%.prototype.keys ( )
        20. 23.2.3.20 %TypedArray%.prototype.lastIndexOf (searchElement [ ,fromIndex ] )
        21. 23.2.3.21 get %TypedArray%.prototype.length
        22. 23.2.3.22 %TypedArray%.prototype.map (callback [ ,thisArg ] )
        23. 23.2.3.23 %TypedArray%.prototype.reduce (callback [ ,initialValue ] )
        24. 23.2.3.24 %TypedArray%.prototype.reduceRight (callback [ ,initialValue ] )
        25. 23.2.3.25 %TypedArray%.prototype.reverse ( )
        26. +23.2.3.26 %TypedArray%.prototype.set (source [ ,offset ] )
          1. 23.2.3.26.1 SetTypedArrayFromArrayLike (target,targetOffset,source )
          2. 23.2.3.26.2 SetTypedArrayFromTypedArray (target,targetOffset,source )
        27. 23.2.3.27 %TypedArray%.prototype.slice (start,end )
        28. 23.2.3.28 %TypedArray%.prototype.some (callback [ ,thisArg ] )
        29. 23.2.3.29 %TypedArray%.prototype.sort (comparator )
        30. 23.2.3.30 %TypedArray%.prototype.subarray (start,end )
        31. 23.2.3.31 %TypedArray%.prototype.toLocaleString ( [reserved1 [ ,reserved2 ] ] )
        32. 23.2.3.32 %TypedArray%.prototype.toReversed ( )
        33. 23.2.3.33 %TypedArray%.prototype.toSorted (comparator )
        34. 23.2.3.34 %TypedArray%.prototype.toString ( )
        35. 23.2.3.35 %TypedArray%.prototype.values ( )
        36. 23.2.3.36 %TypedArray%.prototype.with (index,value )
        37. 23.2.3.37 %TypedArray%.prototype [ %Symbol.iterator% ] ( )
        38. 23.2.3.38 get %TypedArray%.prototype [ %Symbol.toStringTag% ]
      4. +23.2.4 Abstract Operations for TypedArray Objects
        1. 23.2.4.1 TypedArrayCreateFromConstructor (constructor,argumentList )
        2. 23.2.4.2 TypedArrayCreateSameType (exemplar,length )
        3. 23.2.4.3 TypedArraySpeciesCreate (exemplar,argumentList )
        4. 23.2.4.4 ValidateTypedArray (O,order )
        5. 23.2.4.5 TypedArrayElementSize (O )
        6. 23.2.4.6 TypedArrayElementType (O )
        7. 23.2.4.7 CompareTypedArrayElements (x,y,comparator )
      5. +23.2.5 TheTypedArray Constructors
        1. +23.2.5.1TypedArray ( ...args )
          1. 23.2.5.1.1 AllocateTypedArray (constructorName,newTarget,defaultProto [ ,length ] )
          2. 23.2.5.1.2 InitializeTypedArrayFromTypedArray (O,srcArray )
          3. 23.2.5.1.3 InitializeTypedArrayFromArrayBuffer (O,buffer,byteOffset,length )
          4. 23.2.5.1.4 InitializeTypedArrayFromList (O,values )
          5. 23.2.5.1.5 InitializeTypedArrayFromArrayLike (O,arrayLike )
          6. 23.2.5.1.6 AllocateTypedArrayBuffer (O,length )
      6. +23.2.6 Properties of theTypedArray Constructors
        1. 23.2.6.1TypedArray.BYTES_PER_ELEMENT
        2. 23.2.6.2TypedArray.prototype
      7. +23.2.7 Properties of theTypedArray Prototype Objects
        1. 23.2.7.1TypedArray.prototype.BYTES_PER_ELEMENT
        2. 23.2.7.2TypedArray.prototype.constructor
      8. 23.2.8 Properties ofTypedArray Instances
    3. +23.3 Uint8Array Objects
      1. +23.3.1 Additional Properties of the Uint8Array Constructor
        1. 23.3.1.1 Uint8Array.fromBase64 (string [ ,options ] )
        2. 23.3.1.2 Uint8Array.fromHex (string )
      2. +23.3.2 Additional Properties of the Uint8Array Prototype Object
        1. 23.3.2.1 Uint8Array.prototype.setFromBase64 (string [ ,options ] )
        2. 23.3.2.2 Uint8Array.prototype.setFromHex (string )
        3. 23.3.2.3 Uint8Array.prototype.toBase64 ( [options ] )
        4. 23.3.2.4 Uint8Array.prototype.toHex ( )
      3. +23.3.3 Abstract Operations for Uint8Array Objects
        1. 23.3.3.1 ValidateUint8Array (ta )
        2. 23.3.3.2 GetUint8ArrayBytes (ta )
        3. 23.3.3.3 SetUint8ArrayBytes (into,bytes )
        4. 23.3.3.4 SkipAsciiWhitespace (string,index )
        5. 23.3.3.5 DecodeFinalBase64Chunk (chunk,throwOnExtraBits )
        6. 23.3.3.6 DecodeFullLengthBase64Chunk (chunk )
        7. 23.3.3.7 FromBase64 (string,alphabet,lastChunkHandling [ ,maxLength ] )
        8. 23.3.3.8 FromHex (string [ ,maxLength ] )
  25. +24 Keyed Collections
    1. +24.1 Map Objects
      1. +24.1.1 The Map Constructor
        1. 24.1.1.1 Map ( [iterable ] )
        2. 24.1.1.2 AddEntriesFromIterable (target,iterable,adder )
      2. +24.1.2 Properties of the Map Constructor
        1. 24.1.2.1 Map.groupBy (items,callback )
        2. 24.1.2.2 Map.prototype
        3. 24.1.2.3 get Map [ %Symbol.species% ]
      3. +24.1.3 Properties of the Map Prototype Object
        1. 24.1.3.1 Map.prototype.clear ( )
        2. 24.1.3.2 Map.prototype.constructor
        3. 24.1.3.3 Map.prototype.delete (key )
        4. 24.1.3.4 Map.prototype.entries ( )
        5. 24.1.3.5 Map.prototype.forEach (callback [ ,thisArg ] )
        6. 24.1.3.6 Map.prototype.get (key )
        7. 24.1.3.7 Map.prototype.has (key )
        8. 24.1.3.8 Map.prototype.keys ( )
        9. 24.1.3.9 Map.prototype.set (key,value )
        10. 24.1.3.10 get Map.prototype.size
        11. 24.1.3.11 Map.prototype.values ( )
        12. 24.1.3.12 Map.prototype [ %Symbol.iterator% ] ( )
        13. 24.1.3.13 Map.prototype [ %Symbol.toStringTag% ]
      4. 24.1.4 Properties of Map Instances
      5. +24.1.5 Map Iterator Objects
        1. 24.1.5.1 CreateMapIterator (map,kind )
        2. +24.1.5.2 The %MapIteratorPrototype% Object
          1. 24.1.5.2.1 %MapIteratorPrototype%.next ( )
          2. 24.1.5.2.2 %MapIteratorPrototype% [ %Symbol.toStringTag% ]
    2. +24.2 Set Objects
      1. +24.2.1 Abstract Operations For Set Objects
        1. 24.2.1.1 Set Records
        2. 24.2.1.2 GetSetRecord (obj )
        3. 24.2.1.3 SetDataHas (setData,value )
        4. 24.2.1.4 SetDataIndex (setData,value )
        5. 24.2.1.5 SetDataSize (setData )
      2. +24.2.2 The Set Constructor
        1. 24.2.2.1 Set ( [iterable ] )
      3. +24.2.3 Properties of the Set Constructor
        1. 24.2.3.1 Set.prototype
        2. 24.2.3.2 get Set [ %Symbol.species% ]
      4. +24.2.4 Properties of the Set Prototype Object
        1. 24.2.4.1 Set.prototype.add (value )
        2. 24.2.4.2 Set.prototype.clear ( )
        3. 24.2.4.3 Set.prototype.constructor
        4. 24.2.4.4 Set.prototype.delete (value )
        5. 24.2.4.5 Set.prototype.difference (other )
        6. 24.2.4.6 Set.prototype.entries ( )
        7. 24.2.4.7 Set.prototype.forEach (callback [ ,thisArg ] )
        8. 24.2.4.8 Set.prototype.has (value )
        9. 24.2.4.9 Set.prototype.intersection (other )
        10. 24.2.4.10 Set.prototype.isDisjointFrom (other )
        11. 24.2.4.11 Set.prototype.isSubsetOf (other )
        12. 24.2.4.12 Set.prototype.isSupersetOf (other )
        13. 24.2.4.13 Set.prototype.keys ( )
        14. 24.2.4.14 get Set.prototype.size
        15. 24.2.4.15 Set.prototype.symmetricDifference (other )
        16. 24.2.4.16 Set.prototype.union (other )
        17. 24.2.4.17 Set.prototype.values ( )
        18. 24.2.4.18 Set.prototype [ %Symbol.iterator% ] ( )
        19. 24.2.4.19 Set.prototype [ %Symbol.toStringTag% ]
      5. 24.2.5 Properties of Set Instances
      6. +24.2.6 Set Iterator Objects
        1. 24.2.6.1 CreateSetIterator (set,kind )
        2. +24.2.6.2 The %SetIteratorPrototype% Object
          1. 24.2.6.2.1 %SetIteratorPrototype%.next ( )
          2. 24.2.6.2.2 %SetIteratorPrototype% [ %Symbol.toStringTag% ]
    3. +24.3 WeakMap Objects
      1. +24.3.1 The WeakMap Constructor
        1. 24.3.1.1 WeakMap ( [iterable ] )
      2. +24.3.2 Properties of the WeakMap Constructor
        1. 24.3.2.1 WeakMap.prototype
      3. +24.3.3 Properties of the WeakMap Prototype Object
        1. 24.3.3.1 WeakMap.prototype.constructor
        2. 24.3.3.2 WeakMap.prototype.delete (key )
        3. 24.3.3.3 WeakMap.prototype.get (key )
        4. 24.3.3.4 WeakMap.prototype.has (key )
        5. 24.3.3.5 WeakMap.prototype.set (key,value )
        6. 24.3.3.6 WeakMap.prototype [ %Symbol.toStringTag% ]
      4. 24.3.4 Properties of WeakMap Instances
    4. +24.4 WeakSet Objects
      1. +24.4.1 The WeakSet Constructor
        1. 24.4.1.1 WeakSet ( [iterable ] )
      2. +24.4.2 Properties of the WeakSet Constructor
        1. 24.4.2.1 WeakSet.prototype
      3. +24.4.3 Properties of the WeakSet Prototype Object
        1. 24.4.3.1 WeakSet.prototype.add (value )
        2. 24.4.3.2 WeakSet.prototype.constructor
        3. 24.4.3.3 WeakSet.prototype.delete (value )
        4. 24.4.3.4 WeakSet.prototype.has (value )
        5. 24.4.3.5 WeakSet.prototype [ %Symbol.toStringTag% ]
      4. 24.4.4 Properties of WeakSet Instances
    5. +24.5 Abstract Operations for Keyed Collections
      1. 24.5.1 CanonicalizeKeyedCollectionKey (key )
  26. +25 Structured Data
    1. +25.1 ArrayBuffer Objects
      1. 25.1.1 Notation
      2. 25.1.2 Fixed-length and Resizable ArrayBuffer Objects
      3. +25.1.3 Abstract Operations For ArrayBuffer Objects
        1. 25.1.3.1 AllocateArrayBuffer (constructor,byteLength [ ,maxByteLength ] )
        2. 25.1.3.2 ArrayBufferByteLength (arrayBuffer,order )
        3. 25.1.3.3 ArrayBufferCopyAndDetach (arrayBuffer,newLength,preserveResizability )
        4. 25.1.3.4 IsDetachedBuffer (arrayBuffer )
        5. 25.1.3.5 DetachArrayBuffer (arrayBuffer [ ,key ] )
        6. 25.1.3.6 CloneArrayBuffer (srcBuffer,srcByteOffset,srcLength )
        7. 25.1.3.7 GetArrayBufferMaxByteLengthOption (options )
        8. 25.1.3.8 HostResizeArrayBuffer (buffer,newByteLength )
        9. 25.1.3.9 IsFixedLengthArrayBuffer (arrayBuffer )
        10. 25.1.3.10 IsUnsignedElementType (type )
        11. 25.1.3.11 IsUnclampedIntegerElementType (type )
        12. 25.1.3.12 IsBigIntElementType (type )
        13. 25.1.3.13 IsNoTearConfiguration (type,order )
        14. 25.1.3.14 RawBytesToNumeric (type,rawBytes,isLittleEndian )
        15. 25.1.3.15 GetRawBytesFromSharedBlock (block,byteIndex,type,isTypedArray,order )
        16. 25.1.3.16 GetValueFromBuffer (arrayBuffer,byteIndex,type,isTypedArray,order [ ,isLittleEndian ] )
        17. 25.1.3.17 NumericToRawBytes (type,value,isLittleEndian )
        18. 25.1.3.18 SetValueInBuffer (arrayBuffer,byteIndex,type,value,isTypedArray,order [ ,isLittleEndian ] )
        19. 25.1.3.19 GetModifySetValueInBuffer (arrayBuffer,byteIndex,type,value,op )
      4. +25.1.4 The ArrayBuffer Constructor
        1. 25.1.4.1 ArrayBuffer (length [ ,options ] )
      5. +25.1.5 Properties of the ArrayBuffer Constructor
        1. 25.1.5.1 ArrayBuffer.isView (arg )
        2. 25.1.5.2 ArrayBuffer.prototype
        3. 25.1.5.3 get ArrayBuffer [ %Symbol.species% ]
      6. +25.1.6 Properties of the ArrayBuffer Prototype Object
        1. 25.1.6.1 get ArrayBuffer.prototype.byteLength
        2. 25.1.6.2 ArrayBuffer.prototype.constructor
        3. 25.1.6.3 get ArrayBuffer.prototype.detached
        4. 25.1.6.4 get ArrayBuffer.prototype.maxByteLength
        5. 25.1.6.5 get ArrayBuffer.prototype.resizable
        6. 25.1.6.6 ArrayBuffer.prototype.resize (newLength )
        7. 25.1.6.7 ArrayBuffer.prototype.slice (start,end )
        8. 25.1.6.8 ArrayBuffer.prototype.transfer ( [newLength ] )
        9. 25.1.6.9 ArrayBuffer.prototype.transferToFixedLength ( [newLength ] )
        10. 25.1.6.10 ArrayBuffer.prototype [ %Symbol.toStringTag% ]
      7. 25.1.7 Properties of ArrayBuffer Instances
      8. 25.1.8 Resizable ArrayBuffer Guidelines
    2. +25.2 SharedArrayBuffer Objects
      1. 25.2.1 Fixed-length and Growable SharedArrayBuffer Objects
      2. +25.2.2 Abstract Operations for SharedArrayBuffer Objects
        1. 25.2.2.1 AllocateSharedArrayBuffer (constructor,byteLength [ ,maxByteLength ] )
        2. 25.2.2.2 IsSharedArrayBuffer (obj )
        3. 25.2.2.3 HostGrowSharedArrayBuffer (buffer,newByteLength )
      3. +25.2.3 The SharedArrayBuffer Constructor
        1. 25.2.3.1 SharedArrayBuffer (length [ ,options ] )
      4. +25.2.4 Properties of the SharedArrayBuffer Constructor
        1. 25.2.4.1 SharedArrayBuffer.prototype
        2. 25.2.4.2 get SharedArrayBuffer [ %Symbol.species% ]
      5. +25.2.5 Properties of the SharedArrayBuffer Prototype Object
        1. 25.2.5.1 get SharedArrayBuffer.prototype.byteLength
        2. 25.2.5.2 SharedArrayBuffer.prototype.constructor
        3. 25.2.5.3 SharedArrayBuffer.prototype.grow (newLength )
        4. 25.2.5.4 get SharedArrayBuffer.prototype.growable
        5. 25.2.5.5 get SharedArrayBuffer.prototype.maxByteLength
        6. 25.2.5.6 SharedArrayBuffer.prototype.slice (start,end )
        7. 25.2.5.7 SharedArrayBuffer.prototype [ %Symbol.toStringTag% ]
      6. 25.2.6 Properties of SharedArrayBuffer Instances
      7. 25.2.7 Growable SharedArrayBuffer Guidelines
    3. +25.3 DataView Objects
      1. +25.3.1 Abstract Operations For DataView Objects
        1. 25.3.1.1 DataView With Buffer Witness Records
        2. 25.3.1.2 MakeDataViewWithBufferWitnessRecord (obj,order )
        3. 25.3.1.3 GetViewByteLength (viewRecord )
        4. 25.3.1.4 IsViewOutOfBounds (viewRecord )
        5. 25.3.1.5 GetViewValue (view,requestIndex,isLittleEndian,type )
        6. 25.3.1.6 SetViewValue (view,requestIndex,isLittleEndian,type,value )
      2. +25.3.2 The DataView Constructor
        1. 25.3.2.1 DataView (buffer [ ,byteOffset [ ,byteLength ] ] )
      3. +25.3.3 Properties of the DataView Constructor
        1. 25.3.3.1 DataView.prototype
      4. +25.3.4 Properties of the DataView Prototype Object
        1. 25.3.4.1 get DataView.prototype.buffer
        2. 25.3.4.2 get DataView.prototype.byteLength
        3. 25.3.4.3 get DataView.prototype.byteOffset
        4. 25.3.4.4 DataView.prototype.constructor
        5. 25.3.4.5 DataView.prototype.getBigInt64 (byteOffset [ ,littleEndian ] )
        6. 25.3.4.6 DataView.prototype.getBigUint64 (byteOffset [ ,littleEndian ] )
        7. 25.3.4.7 DataView.prototype.getFloat16 (byteOffset [ ,littleEndian ] )
        8. 25.3.4.8 DataView.prototype.getFloat32 (byteOffset [ ,littleEndian ] )
        9. 25.3.4.9 DataView.prototype.getFloat64 (byteOffset [ ,littleEndian ] )
        10. 25.3.4.10 DataView.prototype.getInt8 (byteOffset )
        11. 25.3.4.11 DataView.prototype.getInt16 (byteOffset [ ,littleEndian ] )
        12. 25.3.4.12 DataView.prototype.getInt32 (byteOffset [ ,littleEndian ] )
        13. 25.3.4.13 DataView.prototype.getUint8 (byteOffset )
        14. 25.3.4.14 DataView.prototype.getUint16 (byteOffset [ ,littleEndian ] )
        15. 25.3.4.15 DataView.prototype.getUint32 (byteOffset [ ,littleEndian ] )
        16. 25.3.4.16 DataView.prototype.setBigInt64 (byteOffset,value [ ,littleEndian ] )
        17. 25.3.4.17 DataView.prototype.setBigUint64 (byteOffset,value [ ,littleEndian ] )
        18. 25.3.4.18 DataView.prototype.setFloat16 (byteOffset,value [ ,littleEndian ] )
        19. 25.3.4.19 DataView.prototype.setFloat32 (byteOffset,value [ ,littleEndian ] )
        20. 25.3.4.20 DataView.prototype.setFloat64 (byteOffset,value [ ,littleEndian ] )
        21. 25.3.4.21 DataView.prototype.setInt8 (byteOffset,value )
        22. 25.3.4.22 DataView.prototype.setInt16 (byteOffset,value [ ,littleEndian ] )
        23. 25.3.4.23 DataView.prototype.setInt32 (byteOffset,value [ ,littleEndian ] )
        24. 25.3.4.24 DataView.prototype.setUint8 (byteOffset,value )
        25. 25.3.4.25 DataView.prototype.setUint16 (byteOffset,value [ ,littleEndian ] )
        26. 25.3.4.26 DataView.prototype.setUint32 (byteOffset,value [ ,littleEndian ] )
        27. 25.3.4.27 DataView.prototype [ %Symbol.toStringTag% ]
      5. 25.3.5 Properties of DataView Instances
    4. +25.4 The Atomics Object
      1. 25.4.1 Waiter Record
      2. 25.4.2 WaiterList Records
      3. +25.4.3 Abstract Operations for Atomics
        1. 25.4.3.1 ValidateIntegerTypedArray (typedArray,waitable )
        2. 25.4.3.2 ValidateAtomicAccess (taRecord,requestIndex )
        3. 25.4.3.3 ValidateAtomicAccessOnIntegerTypedArray (typedArray,requestIndex )
        4. 25.4.3.4 RevalidateAtomicAccess (typedArray,byteIndexInBuffer )
        5. 25.4.3.5 GetWaiterList (block,i )
        6. 25.4.3.6 EnterCriticalSection (WL )
        7. 25.4.3.7 LeaveCriticalSection (WL )
        8. 25.4.3.8 AddWaiter (WL,waiterRecord )
        9. 25.4.3.9 RemoveWaiter (WL,waiterRecord )
        10. 25.4.3.10 RemoveWaiters (WL,c )
        11. 25.4.3.11 SuspendThisAgent (WL,waiterRecord )
        12. 25.4.3.12 NotifyWaiter (WL,waiterRecord )
        13. 25.4.3.13 EnqueueResolveInAgentJob (agentSignifier,promiseCapability,resolution )
        14. 25.4.3.14 DoWait (mode,typedArray,index,value,timeout )
        15. 25.4.3.15 EnqueueAtomicsWaitAsyncTimeoutJob (WL,waiterRecord )
        16. 25.4.3.16 AtomicCompareExchangeInSharedBlock (block,byteIndexInBuffer,elementSize,expectedBytes,replacementBytes )
        17. 25.4.3.17 AtomicReadModifyWrite (typedArray,index,value,op )
        18. 25.4.3.18 ByteListBitwiseOp (op,xBytes,yBytes )
        19. 25.4.3.19 ByteListEqual (xBytes,yBytes )
      4. 25.4.4 Atomics.add (typedArray,index,value )
      5. 25.4.5 Atomics.and (typedArray,index,value )
      6. 25.4.6 Atomics.compareExchange (typedArray,index,expectedValue,replacementValue )
      7. 25.4.7 Atomics.exchange (typedArray,index,value )
      8. 25.4.8 Atomics.isLockFree (size )
      9. 25.4.9 Atomics.load (typedArray,index )
      10. 25.4.10 Atomics.or (typedArray,index,value )
      11. 25.4.11 Atomics.store (typedArray,index,value )
      12. 25.4.12 Atomics.sub (typedArray,index,value )
      13. 25.4.13 Atomics.wait (typedArray,index,value,timeout )
      14. 25.4.14 Atomics.waitAsync (typedArray,index,value,timeout )
      15. 25.4.15 Atomics.notify (typedArray,index,count )
      16. 25.4.16 Atomics.xor (typedArray,index,value )
      17. 25.4.17 Atomics [ %Symbol.toStringTag% ]
    5. +25.5 The JSON Object
      1. +25.5.1 JSON.parse (text [ ,reviver ] )
        1. 25.5.1.1 ParseJSON (text )
        2. 25.5.1.2 InternalizeJSONProperty (holder,name,reviver )
      2. +25.5.2 JSON.stringify (value [ ,replacer [ ,space ] ] )
        1. 25.5.2.1 JSON Serialization Record
        2. 25.5.2.2 SerializeJSONProperty (state,key,holder )
        3. 25.5.2.3 QuoteJSONString (value )
        4. 25.5.2.4 UnicodeEscape (C )
        5. 25.5.2.5 SerializeJSONObject (state,value )
        6. 25.5.2.6 SerializeJSONArray (state,value )
      3. 25.5.3 JSON [ %Symbol.toStringTag% ]
  27. +26 Managing Memory
    1. +26.1 WeakRef Objects
      1. +26.1.1 The WeakRef Constructor
        1. 26.1.1.1 WeakRef (target )
      2. +26.1.2 Properties of the WeakRef Constructor
        1. 26.1.2.1 WeakRef.prototype
      3. +26.1.3 Properties of the WeakRef Prototype Object
        1. 26.1.3.1 WeakRef.prototype.constructor
        2. 26.1.3.2 WeakRef.prototype.deref ( )
        3. 26.1.3.3 WeakRef.prototype [ %Symbol.toStringTag% ]
      4. +26.1.4 WeakRef Abstract Operations
        1. 26.1.4.1 WeakRefDeref (weakRef )
      5. 26.1.5 Properties of WeakRef Instances
    2. +26.2 FinalizationRegistry Objects
      1. +26.2.1 The FinalizationRegistry Constructor
        1. 26.2.1.1 FinalizationRegistry (cleanupCallback )
      2. +26.2.2 Properties of the FinalizationRegistry Constructor
        1. 26.2.2.1 FinalizationRegistry.prototype
      3. +26.2.3 Properties of the FinalizationRegistry Prototype Object
        1. 26.2.3.1 FinalizationRegistry.prototype.constructor
        2. 26.2.3.2 FinalizationRegistry.prototype.register (target,heldValue [ ,unregisterToken ] )
        3. 26.2.3.3 FinalizationRegistry.prototype.unregister (unregisterToken )
        4. 26.2.3.4 FinalizationRegistry.prototype [ %Symbol.toStringTag% ]
      4. 26.2.4 Properties of FinalizationRegistry Instances
  28. +27 Control Abstraction Objects
    1. +27.1 Iteration
      1. +27.1.1 Common Iteration Interfaces
        1. 27.1.1.1 The Iterable Interface
        2. 27.1.1.2 The Iterator Interface
        3. 27.1.1.3 The Async Iterable Interface
        4. 27.1.1.4 The Async Iterator Interface
        5. 27.1.1.5 The IteratorResult Interface
      2. +27.1.2 Iterator Helper Objects
        1. +27.1.2.1 The %IteratorHelperPrototype% Object
          1. 27.1.2.1.1 %IteratorHelperPrototype%.next ( )
          2. 27.1.2.1.2 %IteratorHelperPrototype%.return ( )
          3. 27.1.2.1.3 %IteratorHelperPrototype% [ %Symbol.toStringTag% ]
      3. +27.1.3 Iterator Objects
        1. +27.1.3.1 The Iterator Constructor
          1. 27.1.3.1.1 Iterator ( )
        2. +27.1.3.2 Properties of the Iterator Constructor
          1. +27.1.3.2.1 Iterator.from (O )
            1. +27.1.3.2.1.1 The %WrapForValidIteratorPrototype% Object
              1. 27.1.3.2.1.1.1 %WrapForValidIteratorPrototype%.next ( )
              2. 27.1.3.2.1.1.2 %WrapForValidIteratorPrototype%.return ( )
          2. 27.1.3.2.2 Iterator.prototype
        3. +27.1.3.3 Properties of the Iterator Prototype Object
          1. +27.1.3.3.1 Iterator.prototype.constructor
            1. 27.1.3.3.1.1 get Iterator.prototype.constructor
            2. 27.1.3.3.1.2 set Iterator.prototype.constructor
          2. 27.1.3.3.2 Iterator.prototype.drop (limit )
          3. 27.1.3.3.3 Iterator.prototype.every (predicate )
          4. 27.1.3.3.4 Iterator.prototype.filter (predicate )
          5. 27.1.3.3.5 Iterator.prototype.find (predicate )
          6. 27.1.3.3.6 Iterator.prototype.flatMap (mapper )
          7. 27.1.3.3.7 Iterator.prototype.forEach (procedure )
          8. 27.1.3.3.8 Iterator.prototype.map (mapper )
          9. 27.1.3.3.9 Iterator.prototype.reduce (reducer [ ,initialValue ] )
          10. 27.1.3.3.10 Iterator.prototype.some (predicate )
          11. 27.1.3.3.11 Iterator.prototype.take (limit )
          12. 27.1.3.3.12 Iterator.prototype.toArray ( )
          13. 27.1.3.3.13 Iterator.prototype [ %Symbol.iterator% ] ( )
          14. +27.1.3.3.14 Iterator.prototype [ %Symbol.toStringTag% ]
            1. 27.1.3.3.14.1 get Iterator.prototype [ %Symbol.toStringTag% ]
            2. 27.1.3.3.14.2 set Iterator.prototype [ %Symbol.toStringTag% ]
      4. +27.1.4 The %AsyncIteratorPrototype% Object
        1. 27.1.4.1 %AsyncIteratorPrototype% [ %Symbol.asyncIterator% ] ( )
      5. +27.1.5 Async-from-Sync Iterator Objects
        1. 27.1.5.1 CreateAsyncFromSyncIterator (syncIteratorRecord )
        2. +27.1.5.2 The %AsyncFromSyncIteratorPrototype% Object
          1. 27.1.5.2.1 %AsyncFromSyncIteratorPrototype%.next ( [value ] )
          2. 27.1.5.2.2 %AsyncFromSyncIteratorPrototype%.return ( [value ] )
          3. 27.1.5.2.3 %AsyncFromSyncIteratorPrototype%.throw ( [value ] )
        3. 27.1.5.3 Properties of Async-from-Sync Iterator Instances
        4. 27.1.5.4 AsyncFromSyncIteratorContinuation (result,promiseCapability,syncIteratorRecord,closeOnRejection )
    2. +27.2 Promise Objects
      1. +27.2.1 Promise Abstract Operations
        1. +27.2.1.1 PromiseCapability Records
          1. 27.2.1.1.1 IfAbruptRejectPromise (value,capability )
        2. 27.2.1.2 PromiseReaction Records
        3. +27.2.1.3 CreateResolvingFunctions (promise )
          1. 27.2.1.3.1 Promise Reject Functions
          2. 27.2.1.3.2 Promise Resolve Functions
        4. 27.2.1.4 FulfillPromise (promise,value )
        5. 27.2.1.5 NewPromiseCapability (C )
        6. 27.2.1.6 IsPromise (x )
        7. 27.2.1.7 RejectPromise (promise,reason )
        8. 27.2.1.8 TriggerPromiseReactions (reactions,argument )
        9. 27.2.1.9 HostPromiseRejectionTracker (promise,operation )
      2. +27.2.2 Promise Jobs
        1. 27.2.2.1 NewPromiseReactionJob (reaction,argument )
        2. 27.2.2.2 NewPromiseResolveThenableJob (promiseToResolve,thenable,then )
      3. +27.2.3 The Promise Constructor
        1. 27.2.3.1 Promise (executor )
      4. +27.2.4 Properties of the Promise Constructor
        1. +27.2.4.1 Promise.all (iterable )
          1. 27.2.4.1.1 GetPromiseResolve (promiseConstructor )
          2. 27.2.4.1.2 PerformPromiseAll (iteratorRecord,constructor,resultCapability,promiseResolve )
          3. 27.2.4.1.3Promise.all Resolve Element Functions
        2. +27.2.4.2 Promise.allSettled (iterable )
          1. 27.2.4.2.1 PerformPromiseAllSettled (iteratorRecord,constructor,resultCapability,promiseResolve )
          2. 27.2.4.2.2Promise.allSettled Resolve Element Functions
          3. 27.2.4.2.3Promise.allSettled Reject Element Functions
        3. +27.2.4.3 Promise.any (iterable )
          1. 27.2.4.3.1 PerformPromiseAny (iteratorRecord,constructor,resultCapability,promiseResolve )
          2. 27.2.4.3.2Promise.any Reject Element Functions
        4. 27.2.4.4 Promise.prototype
        5. +27.2.4.5 Promise.race (iterable )
          1. 27.2.4.5.1 PerformPromiseRace (iteratorRecord,constructor,resultCapability,promiseResolve )
        6. 27.2.4.6 Promise.reject (r )
        7. +27.2.4.7 Promise.resolve (x )
          1. 27.2.4.7.1 PromiseResolve (C,x )
        8. 27.2.4.8 Promise.try (callback, ...args )
        9. 27.2.4.9 Promise.withResolvers ( )
        10. 27.2.4.10 get Promise [ %Symbol.species% ]
      5. +27.2.5 Properties of the Promise Prototype Object
        1. 27.2.5.1 Promise.prototype.catch (onRejected )
        2. 27.2.5.2 Promise.prototype.constructor
        3. 27.2.5.3 Promise.prototype.finally (onFinally )
        4. +27.2.5.4 Promise.prototype.then (onFulfilled,onRejected )
          1. 27.2.5.4.1 PerformPromiseThen (promise,onFulfilled,onRejected [ ,resultCapability ] )
        5. 27.2.5.5 Promise.prototype [ %Symbol.toStringTag% ]
      6. 27.2.6 Properties of Promise Instances
    3. +27.3 GeneratorFunction Objects
      1. +27.3.1 The GeneratorFunction Constructor
        1. 27.3.1.1 GeneratorFunction ( ...parameterArgs,bodyArg )
      2. +27.3.2 Properties of the GeneratorFunction Constructor
        1. 27.3.2.1 GeneratorFunction.prototype
      3. +27.3.3 Properties of the GeneratorFunction Prototype Object
        1. 27.3.3.1 GeneratorFunction.prototype.constructor
        2. 27.3.3.2 GeneratorFunction.prototype.prototype
        3. 27.3.3.3 GeneratorFunction.prototype [ %Symbol.toStringTag% ]
      4. +27.3.4 GeneratorFunction Instances
        1. 27.3.4.1 length
        2. 27.3.4.2 name
        3. 27.3.4.3 prototype
    4. +27.4 AsyncGeneratorFunction Objects
      1. +27.4.1 The AsyncGeneratorFunction Constructor
        1. 27.4.1.1 AsyncGeneratorFunction ( ...parameterArgs,bodyArg )
      2. +27.4.2 Properties of the AsyncGeneratorFunction Constructor
        1. 27.4.2.1 AsyncGeneratorFunction.prototype
      3. +27.4.3 Properties of the AsyncGeneratorFunction Prototype Object
        1. 27.4.3.1 AsyncGeneratorFunction.prototype.constructor
        2. 27.4.3.2 AsyncGeneratorFunction.prototype.prototype
        3. 27.4.3.3 AsyncGeneratorFunction.prototype [ %Symbol.toStringTag% ]
      4. +27.4.4 AsyncGeneratorFunction Instances
        1. 27.4.4.1 length
        2. 27.4.4.2 name
        3. 27.4.4.3 prototype
    5. +27.5 Generator Objects
      1. +27.5.1 The %GeneratorPrototype% Object
        1. 27.5.1.1 %GeneratorPrototype%.constructor
        2. 27.5.1.2 %GeneratorPrototype%.next (value )
        3. 27.5.1.3 %GeneratorPrototype%.return (value )
        4. 27.5.1.4 %GeneratorPrototype%.throw (exception )
        5. 27.5.1.5 %GeneratorPrototype% [ %Symbol.toStringTag% ]
      2. 27.5.2 Properties of Generator Instances
      3. +27.5.3 Generator Abstract Operations
        1. 27.5.3.1 GeneratorStart (generator,generatorBody )
        2. 27.5.3.2 GeneratorValidate (generator,generatorBrand )
        3. 27.5.3.3 GeneratorResume (generator,value,generatorBrand )
        4. 27.5.3.4 GeneratorResumeAbrupt (generator,abruptCompletion,generatorBrand )
        5. 27.5.3.5 GetGeneratorKind ( )
        6. 27.5.3.6 GeneratorYield (iteratorResult )
        7. 27.5.3.7 Yield (value )
        8. 27.5.3.8 CreateIteratorFromClosure (closure,generatorBrand,generatorPrototype [ ,extraSlots ] )
    6. +27.6 AsyncGenerator Objects
      1. +27.6.1 The %AsyncGeneratorPrototype% Object
        1. 27.6.1.1 %AsyncGeneratorPrototype%.constructor
        2. 27.6.1.2 %AsyncGeneratorPrototype%.next (value )
        3. 27.6.1.3 %AsyncGeneratorPrototype%.return (value )
        4. 27.6.1.4 %AsyncGeneratorPrototype%.throw (exception )
        5. 27.6.1.5 %AsyncGeneratorPrototype% [ %Symbol.toStringTag% ]
      2. 27.6.2 Properties of AsyncGenerator Instances
      3. +27.6.3 AsyncGenerator Abstract Operations
        1. 27.6.3.1 AsyncGeneratorRequest Records
        2. 27.6.3.2 AsyncGeneratorStart (generator,generatorBody )
        3. 27.6.3.3 AsyncGeneratorValidate (generator,generatorBrand )
        4. 27.6.3.4 AsyncGeneratorEnqueue (generator,completion,promiseCapability )
        5. 27.6.3.5 AsyncGeneratorCompleteStep (generator,completion,done [ ,realm ] )
        6. 27.6.3.6 AsyncGeneratorResume (generator,completion )
        7. 27.6.3.7 AsyncGeneratorUnwrapYieldResumption (resumptionValue )
        8. 27.6.3.8 AsyncGeneratorYield (value )
        9. 27.6.3.9 AsyncGeneratorAwaitReturn (generator )
        10. 27.6.3.10 AsyncGeneratorDrainQueue (generator )
        11. 27.6.3.11 CreateAsyncIteratorFromClosure (closure,generatorBrand,generatorPrototype )
    7. +27.7 AsyncFunction Objects
      1. +27.7.1 The AsyncFunction Constructor
        1. 27.7.1.1 AsyncFunction ( ...parameterArgs,bodyArg )
      2. +27.7.2 Properties of the AsyncFunction Constructor
        1. 27.7.2.1 AsyncFunction.prototype
      3. +27.7.3 Properties of the AsyncFunction Prototype Object
        1. 27.7.3.1 AsyncFunction.prototype.constructor
        2. 27.7.3.2 AsyncFunction.prototype [ %Symbol.toStringTag% ]
      4. +27.7.4 AsyncFunction Instances
        1. 27.7.4.1 length
        2. 27.7.4.2 name
      5. +27.7.5 Async Functions Abstract Operations
        1. 27.7.5.1 AsyncFunctionStart (promiseCapability,asyncFunctionBody )
        2. 27.7.5.2 AsyncBlockStart (promiseCapability,asyncBody,asyncContext )
        3. 27.7.5.3 Await (value )
  29. +28 Reflection
    1. +28.1 The Reflect Object
      1. 28.1.1 Reflect.apply (target,thisArgument,argumentsList )
      2. 28.1.2 Reflect.construct (target,argumentsList [ ,newTarget ] )
      3. 28.1.3 Reflect.defineProperty (target,propertyKey,attributes )
      4. 28.1.4 Reflect.deleteProperty (target,propertyKey )
      5. 28.1.5 Reflect.get (target,propertyKey [ ,receiver ] )
      6. 28.1.6 Reflect.getOwnPropertyDescriptor (target,propertyKey )
      7. 28.1.7 Reflect.getPrototypeOf (target )
      8. 28.1.8 Reflect.has (target,propertyKey )
      9. 28.1.9 Reflect.isExtensible (target )
      10. 28.1.10 Reflect.ownKeys (target )
      11. 28.1.11 Reflect.preventExtensions (target )
      12. 28.1.12 Reflect.set (target,propertyKey,V [ ,receiver ] )
      13. 28.1.13 Reflect.setPrototypeOf (target,proto )
      14. 28.1.14 Reflect [ %Symbol.toStringTag% ]
    2. +28.2 Proxy Objects
      1. +28.2.1 The Proxy Constructor
        1. 28.2.1.1 Proxy (target,handler )
      2. +28.2.2 Properties of the Proxy Constructor
        1. 28.2.2.1 Proxy.revocable (target,handler )
    3. +28.3 Module Namespace Objects
      1. 28.3.1 %Symbol.toStringTag%
  30. +29 Memory Model
    1. 29.1 Memory Model Fundamentals
    2. 29.2 Agent Events Records
    3. 29.3 Chosen Value Records
    4. 29.4 Candidate Executions
    5. +29.5 Abstract Operations for the Memory Model
      1. 29.5.1 EventSet (execution )
      2. 29.5.2 SharedDataBlockEventSet (execution )
      3. 29.5.3 HostEventSet (execution )
      4. 29.5.4 ComposeWriteEventBytes (execution,byteIndex,Ws )
      5. 29.5.5 ValueOfReadEvent (execution,R )
    6. +29.6 Relations of Candidate Executions
      1. 29.6.1 is-agent-order-before
      2. 29.6.2 reads-bytes-from
      3. 29.6.3 reads-from
      4. 29.6.4 host-synchronizes-with
      5. 29.6.5 synchronizes-with
      6. 29.6.6 happens-before
    7. +29.7 Properties of Valid Executions
      1. 29.7.1 Valid Chosen Reads
      2. 29.7.2 Coherent Reads
      3. 29.7.3 Tear Free Reads
      4. 29.7.4 Sequentially Consistent Atomics
      5. 29.7.5 Valid Executions
    8. 29.8 Races
    9. 29.9 Data Races
    10. 29.10 Data Race Freedom
    11. 29.11 Shared Memory Guidelines
  31. +Annex A(informative) Grammar Summary
    1. A.1 Lexical Grammar
    2. A.2 Expressions
    3. A.3 Statements
    4. A.4 Functions and Classes
    5. A.5 Scripts and Modules
    6. A.6 Number Conversions
    7. A.7 Time Zone Offset String Format
    8. A.8 Regular Expressions
  32. +Annex B(normative) Additional ECMAScript Features for Web Browsers
    1. +B.1 Additional Syntax
      1. B.1.1 HTML-like Comments
      2. +B.1.2 Regular Expressions Patterns
        1. B.1.2.1 SS: Early Errors
        2. B.1.2.2 SS: CountLeftCapturingParensWithin and CountLeftCapturingParensBefore
        3. B.1.2.3 SS: IsCharacterClass
        4. B.1.2.4 SS: CharacterValue
        5. B.1.2.5 RS: CompileSubpattern
        6. B.1.2.6 RS: CompileAssertion
        7. B.1.2.7 RS: CompileAtom
        8. +B.1.2.8 RS: CompileToCharSet
          1. B.1.2.8.1 CharacterRangeOrUnion (rer,A,B )
        9. B.1.2.9 SS: ParsePattern (patternText,u,v )
    2. +B.2 Additional Built-in Properties
      1. +B.2.1 Additional Properties of the Global Object
        1. B.2.1.1 escape (string )
        2. B.2.1.2 unescape (string )
      2. +B.2.2 Additional Properties of the String.prototype Object
        1. B.2.2.1 String.prototype.substr (start,length )
        2. +B.2.2.2 String.prototype.anchor (name )
          1. B.2.2.2.1 CreateHTML (string,tag,attribute,value )
        3. B.2.2.3 String.prototype.big ( )
        4. B.2.2.4 String.prototype.blink ( )
        5. B.2.2.5 String.prototype.bold ( )
        6. B.2.2.6 String.prototype.fixed ( )
        7. B.2.2.7 String.prototype.fontcolor (colour )
        8. B.2.2.8 String.prototype.fontsize (size )
        9. B.2.2.9 String.prototype.italics ( )
        10. B.2.2.10 String.prototype.link (url )
        11. B.2.2.11 String.prototype.small ( )
        12. B.2.2.12 String.prototype.strike ( )
        13. B.2.2.13 String.prototype.sub ( )
        14. B.2.2.14 String.prototype.sup ( )
        15. B.2.2.15 String.prototype.trimLeft ( )
        16. B.2.2.16 String.prototype.trimRight ( )
      3. +B.2.3 Additional Properties of the Date.prototype Object
        1. B.2.3.1 Date.prototype.getYear ( )
        2. B.2.3.2 Date.prototype.setYear (year )
        3. B.2.3.3 Date.prototype.toGMTString ( )
      4. +B.2.4 Additional Properties of the RegExp.prototype Object
        1. B.2.4.1 RegExp.prototype.compile (pattern,flags )
    3. +B.3 Other Additional Features
      1. B.3.1 Labelled Function Declarations
      2. B.3.2 Block-Level Function Declarations Web Legacy Compatibility Semantics
      3. B.3.3 FunctionDeclarations in IfStatement Statement Clauses
      4. B.3.4 VariableStatements in Catch Blocks
      5. B.3.5 Initializers in ForIn Statement Heads
      6. B.3.6 The[[IsHTMLDDA]] Internal Slot
      7. B.3.7 Non-default behaviour in HostMakeJobCallback
      8. B.3.8 Non-default behaviour in HostEnsureCanAddPrivateElement
      9. B.3.9 Runtime Errors for Function Call Assignment Targets
  33. Annex C(informative) The Strict Mode of ECMAScript
  34. +Annex D(informative) Host Layering Points
    1. D.1 Host Hooks
    2. D.2 Host-defined Fields
    3. D.3 Host-defined Objects
    4. D.4 Running Jobs
    5. D.5 Internal Methods of Exotic Objects
    6. D.6 Built-in Objects and Methods
  35. Annex E(informative) Corrections and Clarifications in ECMAScript 2015 with Possible Compatibility Impact
  36. Annex F(informative) Additions and Changes That Introduce Incompatibilities with Prior Editions
  37. Bibliography
  38. Colophon
  39. Copyright & Software License
Menu

22 Text Processing

22.1 String Objects

22.1.1 The String Constructor

The Stringconstructor:

  • is%String%.
  • is the initial value of the"String" property of theglobal object.
  • creates and initializes a new String object when called as aconstructor.
  • performs a type conversion when called as a function rather than as aconstructor.
  • may be used as the value of anextends clause of a class definition. Subclassconstructors that intend to inherit the specified String behaviour must include asuper call to the Stringconstructor to create and initialize the subclass instance with a[[StringData]] internal slot.

22.1.1.1 String (value )

This function performs the following steps when called:

  1. Ifvalue is not present, then
    1. Lets be the empty String.
  2. Else,
    1. If NewTarget isundefined andvalueis a Symbol, returnSymbolDescriptiveString(value).
    2. Lets be ? ToString(value).
  3. If NewTarget isundefined, returns.
  4. ReturnStringCreate(s, ? GetPrototypeFromConstructor(NewTarget,"%String.prototype%")).

22.1.2 Properties of the String Constructor

The Stringconstructor:

22.1.2.1 String.fromCharCode ( ...codeUnits )

This function may be called with any number of arguments which form the rest parametercodeUnits.

It performs the following steps when called:

  1. Letresult be the empty String.
  2. For each elementnext ofcodeUnits, do
    1. LetnextCU be the code unit whose numeric value is(?ToUint16(next)).
    2. Setresult to thestring-concatenation ofresult andnextCU.
  3. Returnresult.

The"length" property of this function is1𝔽.

22.1.2.2 String.fromCodePoint ( ...codePoints )

This function may be called with any number of arguments which form the rest parametercodePoints.

It performs the following steps when called:

  1. Letresult be the empty String.
  2. For each elementnext ofcodePoints, do
    1. LetnextCP be ? ToNumber(next).
    2. IfnextCP is not anintegral Number, throw aRangeError exception.
    3. If(nextCP) < 0 or(nextCP) > 0x10FFFF, throw aRangeError exception.
    4. Setresult to thestring-concatenation ofresult andUTF16EncodeCodePoint((nextCP)).
  3. Assert: IfcodePoints is empty, thenresult is the empty String.
  4. Returnresult.

The"length" property of this function is1𝔽.

22.1.2.3 String.prototype

The initial value ofString.prototype is theString prototype object.

This property has the attributes {[[Writable]]:false,[[Enumerable]]:false,[[Configurable]]:false }.

22.1.2.4 String.raw (template, ...substitutions )

This function may be called with a variable number of arguments. The first argument istemplate and the remainder of the arguments form theListsubstitutions.

It performs the following steps when called:

  1. LetsubstitutionCount be the number of elements insubstitutions.
  2. Letcooked be ? ToObject(template).
  3. Letliterals be ? ToObject(?Get(cooked,"raw")).
  4. LetliteralCount be ? LengthOfArrayLike(literals).
  5. IfliteralCount ≤ 0, return the empty String.
  6. LetR be the empty String.
  7. LetnextIndex be 0.
  8. Repeat,
    1. LetnextLiteralVal be ? Get(literals, ! ToString(𝔽(nextIndex))).
    2. LetnextLiteral be ? ToString(nextLiteralVal).
    3. SetR to thestring-concatenation ofR andnextLiteral.
    4. IfnextIndex + 1 =literalCount, returnR.
    5. IfnextIndex <substitutionCount, then
      1. LetnextSubVal besubstitutions[nextIndex].
      2. LetnextSub be ? ToString(nextSubVal).
      3. SetR to thestring-concatenation ofR andnextSub.
    6. SetnextIndex tonextIndex + 1.
Note

This function is intended for use as a tag function of a Tagged Template (13.3.11). When called as such, the first argument will be a well formed template object and the rest parameter will contain the substitution values.

22.1.3 Properties of the String Prototype Object

TheString prototype object:

  • is%String.prototype%.
  • is a Stringexotic object and has the internal methods specified for such objects.
  • has a[[StringData]] internal slot whose value is the empty String.
  • has a"length" property whose initial value is+0𝔽 and whose attributes are {[[Writable]]:false,[[Enumerable]]:false,[[Configurable]]:false }.
  • has a[[Prototype]] internal slot whose value is%Object.prototype%.

Unless explicitly stated otherwise, the methods of the String prototype object defined below are not generic and thethis value passed to them must be either a String value or an object that has a[[StringData]] internal slot that has been initialized to a String value.

22.1.3.1 String.prototype.at (index )

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letlen be the length ofS.
  5. LetrelativeIndex be ? ToIntegerOrInfinity(index).
  6. IfrelativeIndex ≥ 0, then
    1. Letk berelativeIndex.
  7. Else,
    1. Letk belen +relativeIndex.
  8. Ifk < 0 orklen, returnundefined.
  9. Return thesubstring ofS fromk tok + 1.

22.1.3.2 String.prototype.charAt (pos )

Note 1

This method returns a single element String containing the code unit at indexpos within the String value resulting from converting this object to a String. If there is no element at that index, the result is the empty String. The resultis a String value, not a String object.

Ifpos is anintegral Number, then the result ofx.charAt(pos) is equivalent to the result ofx.substring(pos, pos + 1).

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letposition be ? ToIntegerOrInfinity(pos).
  5. Letsize be the length ofS.
  6. Ifposition < 0 orpositionsize, return the empty String.
  7. Return thesubstring ofS fromposition toposition + 1.
Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.3 String.prototype.charCodeAt (pos )

Note 1

This method returns a Number (a non-negativeintegral Number less than 216) that is the numeric value of the code unit at indexpos within the String resulting from converting this object to a String. If there is no element at that index, the result isNaN.

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letposition be ? ToIntegerOrInfinity(pos).
  5. Letsize be the length ofS.
  6. Ifposition < 0 orpositionsize, returnNaN.
  7. Return theNumber value for the numeric value of the code unit at indexposition within the StringS.
Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.

22.1.3.4 String.prototype.codePointAt (pos )

Note 1

This method returns a non-negativeintegral Number less than or equal to0x10FFFF𝔽 that is the numeric value of the UTF-16 encoded code point (6.1.4) starting at the string element at indexpos within the String resulting from converting this object to a String. If there is no element at that index, the result isundefined. If a valid UTF-16surrogate pair does not begin atpos, the result is the code unit atpos.

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letposition be ? ToIntegerOrInfinity(pos).
  5. Letsize be the length ofS.
  6. Ifposition < 0 orpositionsize, returnundefined.
  7. Letcp beCodePointAt(S,position).
  8. Return𝔽(cp.[[CodePoint]]).
Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.

22.1.3.5 String.prototype.concat ( ...args )

Note 1

When this method is called it returns the String value consisting of the code units of thethis value (converted to a String) followed by the code units of each of the arguments converted to a String. The resultis a String value, not a String object.

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetR beS.
  5. For each elementnext ofargs, do
    1. LetnextString be ? ToString(next).
    2. SetR to thestring-concatenation ofR andnextString.
  6. ReturnR.

The"length" property of this method is1𝔽.

Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.

22.1.3.6 String.prototype.constructor

The initial value ofString.prototype.constructor is%String%.

22.1.3.7 String.prototype.endsWith (searchString [ ,endPosition ] )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetisRegExp be ? IsRegExp(searchString).
  5. IfisRegExp istrue, throw aTypeError exception.
  6. LetsearchStr be ? ToString(searchString).
  7. Letlen be the length ofS.
  8. IfendPosition isundefined, letpos belen; else letpos be ? ToIntegerOrInfinity(endPosition).
  9. Letend be the result ofclampingpos between 0 andlen.
  10. LetsearchLength be the length ofsearchStr.
  11. IfsearchLength = 0, returntrue.
  12. Letstart beend -searchLength.
  13. Ifstart < 0, returnfalse.
  14. Letsubstring be thesubstring ofS fromstart toend.
  15. Ifsubstring issearchStr, returntrue.
  16. Returnfalse.
Note 1

This method returnstrue if the sequence of code units ofsearchString converted to a String is the same as the corresponding code units of this object (converted to a String) starting atendPosition - length(this). Otherwise it returnsfalse.

Note 2

Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.

Note 3

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.8 String.prototype.includes (searchString [ ,position ] )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetisRegExp be ? IsRegExp(searchString).
  5. IfisRegExp istrue, throw aTypeError exception.
  6. LetsearchStr be ? ToString(searchString).
  7. Letpos be ? ToIntegerOrInfinity(position).
  8. Assert: Ifposition isundefined, thenpos is 0.
  9. Letlen be the length ofS.
  10. Letstart be the result ofclampingpos between 0 andlen.
  11. Letindex beStringIndexOf(S,searchStr,start).
  12. Ifindex isnot-found, returnfalse.
  13. Returntrue.
Note 1

IfsearchString appears as asubstring of the result of converting this object to a String, at one or more indices that are greater than or equal toposition, this function returnstrue; otherwise, it returnsfalse. Ifposition isundefined, 0 is assumed, so as to search all of the String.

Note 2

Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.

Note 3

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.9 String.prototype.indexOf (searchString [ ,position ] )

Note 1

IfsearchString appears as asubstring of the result of converting this object to a String, at one or more indices that are greater than or equal toposition, then the smallest such index is returned; otherwise,-1𝔽 is returned. Ifposition isundefined,+0𝔽 is assumed, so as to search all of the String.

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetsearchStr be ? ToString(searchString).
  5. Letpos be ? ToIntegerOrInfinity(position).
  6. Assert: Ifposition isundefined, thenpos is 0.
  7. Letlen be the length ofS.
  8. Letstart be the result ofclampingpos between 0 andlen.
  9. Letresult beStringIndexOf(S,searchStr,start).
  10. Ifresult isnot-found, return-1𝔽.
  11. Return𝔽(result).
Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.10 String.prototype.isWellFormed ( )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. ReturnIsStringWellFormedUnicode(S).

22.1.3.11 String.prototype.lastIndexOf (searchString [ ,position ] )

Note 1

IfsearchString appears as asubstring of the result of converting this object to a String at one or more indices that are smaller than or equal toposition, then the greatest such index is returned; otherwise,-1𝔽 is returned. Ifposition isundefined, the length of the String value is assumed, so as to search all of the String.

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetsearchStr be ? ToString(searchString).
  5. LetnumPos be ? ToNumber(position).
  6. Assert: Ifposition isundefined, thennumPos isNaN.
  7. IfnumPos isNaN, letpos be +∞; otherwise letpos be ! ToIntegerOrInfinity(numPos).
  8. Letlen be the length ofS.
  9. LetsearchLen be the length ofsearchStr.
  10. Iflen <searchLen, return-1𝔽.
  11. Letstart be the result ofclampingpos between 0 andlen -searchLen.
  12. Letresult beStringLastIndexOf(S,searchStr,start).
  13. Ifresult isnot-found, return-1𝔽.
  14. Return𝔽(result).
Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.12 String.prototype.localeCompare (that [ ,reserved1 [ ,reserved2 ] ] )

An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

This method returns a Number other thanNaN representing the result of animplementation-defined locale-sensitive String comparison of thethis value (converted to a StringS) withthat (converted to a StringthatValue). The result is intended to correspond with asort order of String values according to conventions of thehost environment's current locale, and will be negative whenS is ordered beforethatValue, positive whenS is ordered afterthatValue, and zero in all other cases (representing no relative ordering betweenS andthatValue).

Before performing the comparisons, this method performs the following steps to prepare the Strings:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetthatValue be ? ToString(that).

The meaning of the optional second and third parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not assign any other interpretation to those parameter positions.

The actual return values areimplementation-defined to permit encoding additional information in them, but this method, when considered as a method of two arguments, is required to be aconsistent comparator defining a total ordering on the set of all Strings. This method is also required to recognize and honour canonical equivalence according to the Unicode Standard, including returning+0𝔽 when comparing distinguishable Strings that are canonically equivalent.

Note 1

This method itself is not directly suitable as an argument toArray.prototype.sort because the latter requires a function of two arguments.

Note 2

This method may rely on whatever language- and/or locale-sensitive comparison functionality is available to the ECMAScript environment from thehost environment, and is intended to compare according to the conventions of thehost environment's current locale. However, regardless of comparison capabilities, this method must recognize and honour canonical equivalence according to the Unicode Standard—for example, the following comparisons must all return+0𝔽:

// Å ANGSTROM SIGN vs.// Å LATIN CAPITAL LETTER A + COMBINING RING ABOVE"\u212B".localeCompare("A\u030A")// Ω OHM SIGN vs.// Ω GREEK CAPITAL LETTER OMEGA"\u2126".localeCompare("\u03A9")// ṩ LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE vs.// ṩ LATIN SMALL LETTER S + COMBINING DOT ABOVE + COMBINING DOT BELOW"\u1E69".localeCompare("s\u0307\u0323")// ḍ̇ LATIN SMALL LETTER D WITH DOT ABOVE + COMBINING DOT BELOW vs.// ḍ̇ LATIN SMALL LETTER D WITH DOT BELOW + COMBINING DOT ABOVE"\u1E0B\u0323".localeCompare("\u1E0D\u0307")// 가 HANGUL CHOSEONG KIYEOK + HANGUL JUNGSEONG A vs.// 가 HANGUL SYLLABLE GA"\u1100\u1161".localeCompare("\uAC00")

For a definition and discussion of canonical equivalence see the Unicode Standard, chapters 2 and 3, as well asUnicode Standard Annex #15, Unicode Normalization Forms andUnicode Technical Note #5, Canonical Equivalence in Applications. Also seeUnicode Technical Standard #10, Unicode Collation Algorithm.

It is recommended that this method should not honour Unicode compatibility equivalents or compatibility decompositions as defined in the Unicode Standard, chapter 3, section 3.7.

Note 3

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.13 String.prototype.match (regexp )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Ifregexp is neitherundefined nornull, then
    1. Letmatcher be ? GetMethod(regexp,%Symbol.match%).
    2. Ifmatcher is notundefined, then
      1. Return ? Call(matcher,regexp, «O »).
  4. LetS be ? ToString(O).
  5. Letrx be ? RegExpCreate(regexp,undefined).
  6. Return ? Invoke(rx,%Symbol.match%, «S »).
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.14 String.prototype.matchAll (regexp )

This method performs a regular expression match of the String representing thethis value againstregexp and returns aniterator that yields match results. Each match result is an Array containing the matched portion of the String as the first element, followed by the portions matched by any capturing groups. If the regular expression never matches, the returnediterator does not yield any match results.

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Ifregexp is neitherundefined nornull, then
    1. LetisRegExp be ? IsRegExp(regexp).
    2. IfisRegExp istrue, then
      1. Letflags be ? Get(regexp,"flags").
      2. Perform ? RequireObjectCoercible(flags).
      3. If ? ToString(flags) does not contain"g", throw aTypeError exception.
    3. Letmatcher be ? GetMethod(regexp,%Symbol.matchAll%).
    4. Ifmatcher is notundefined, then
      1. Return ? Call(matcher,regexp, «O »).
  4. LetS be ? ToString(O).
  5. Letrx be ? RegExpCreate(regexp,"g").
  6. Return ? Invoke(rx,%Symbol.matchAll%, «S »).
Note 1
This method is intentionally generic, it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.
Note 2
Similarly toString.prototype.split,String.prototype.matchAll is designed to typically act without mutating its inputs.

22.1.3.15 String.prototype.normalize ( [form ] )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Ifform isundefined, letf be"NFC".
  5. Else, letf be ? ToString(form).
  6. Iff is not one of"NFC","NFD","NFKC", or"NFKD", throw aRangeError exception.
  7. Letns be the String value that is the result of normalizingS into the normalization form named byf as specified inthe latest Unicode Standard, Normalization Forms.
  8. Returnns.
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.

22.1.3.16 String.prototype.padEnd (maxLength [ ,fillString ] )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Return ? StringPaddingBuiltinsImpl(O,maxLength,fillString,end).

22.1.3.17 String.prototype.padStart (maxLength [ ,fillString ] )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Return ? StringPaddingBuiltinsImpl(O,maxLength,fillString,start).

22.1.3.17.1 StringPaddingBuiltinsImpl (O,maxLength,fillString,placement )

The abstract operation StringPaddingBuiltinsImpl takes argumentsO (anECMAScript language value),maxLength (anECMAScript language value),fillString (anECMAScript language value), andplacement (start orend) and returns either anormal completion containing a String or athrow completion. It performs the following steps when called:

  1. LetS be ? ToString(O).
  2. LetintMaxLength be(?ToLength(maxLength)).
  3. LetstringLength be the length ofS.
  4. IfintMaxLengthstringLength, returnS.
  5. IffillString isundefined, setfillString to the String value consisting solely of the code unit 0x0020 (SPACE).
  6. Else, setfillString to ? ToString(fillString).
  7. ReturnStringPad(S,intMaxLength,fillString,placement).

22.1.3.17.2 StringPad (S,maxLength,fillString,placement )

The abstract operation StringPad takes argumentsS (a String),maxLength (a non-negativeinteger),fillString (a String), andplacement (start orend) and returns a String. It performs the following steps when called:

  1. LetstringLength be the length ofS.
  2. IfmaxLengthstringLength, returnS.
  3. IffillString is the empty String, returnS.
  4. LetfillLen bemaxLength -stringLength.
  5. LettruncatedStringFiller be the String value consisting of repeated concatenations offillString truncated to lengthfillLen.
  6. Ifplacement isstart, return thestring-concatenation oftruncatedStringFiller andS.
  7. Else, return thestring-concatenation ofS andtruncatedStringFiller.
Note 1

The argumentmaxLength will be clamped such that it can be no smaller than the length ofS.

Note 2

The argumentfillString defaults to" " (the String value consisting of the code unit 0x0020 SPACE).

22.1.3.17.3 ToZeroPaddedDecimalString (n,minLength )

The abstract operation ToZeroPaddedDecimalString takes argumentsn (a non-negativeinteger) andminLength (a non-negativeinteger) and returns a String. It performs the following steps when called:

  1. LetS be the String representation ofn, formatted as a decimal number.
  2. ReturnStringPad(S,minLength,"0",start).

22.1.3.18 String.prototype.repeat (count )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letn be ? ToIntegerOrInfinity(count).
  5. Ifn < 0 orn = +∞, throw aRangeError exception.
  6. Ifn = 0, return the empty String.
  7. Return the String value that is made fromn copies ofS appended together.
Note 1

This method creates the String value consisting of the code units of thethis value (converted to String) repeatedcount times.

Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.19 String.prototype.replace (searchValue,replaceValue )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. IfsearchValue is neitherundefined nornull, then
    1. Letreplacer be ? GetMethod(searchValue,%Symbol.replace%).
    2. Ifreplacer is notundefined, then
      1. Return ? Call(replacer,searchValue, «O,replaceValue »).
  4. Letstring be ? ToString(O).
  5. LetsearchString be ? ToString(searchValue).
  6. LetfunctionalReplace beIsCallable(replaceValue).
  7. IffunctionalReplace isfalse, then
    1. SetreplaceValue to ? ToString(replaceValue).
  8. LetsearchLength be the length ofsearchString.
  9. Letposition beStringIndexOf(string,searchString, 0).
  10. Ifposition isnot-found, returnstring.
  11. Letpreceding be thesubstring ofstring from 0 toposition.
  12. Letfollowing be thesubstring ofstring fromposition +searchLength.
  13. IffunctionalReplace istrue, then
    1. Letreplacement be ? ToString(?Call(replaceValue,undefined, «searchString,𝔽(position),string »)).
  14. Else,
    1. Assert:replaceValueis a String.
    2. Letcaptures be a new emptyList.
    3. Letreplacement be ! GetSubstitution(searchString,string,position,captures,undefined,replaceValue).
  15. Return thestring-concatenation ofpreceding,replacement, andfollowing.
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.19.1 GetSubstitution (matched,str,position,captures,namedCaptures,replacementTemplate )

The abstract operation GetSubstitution takes argumentsmatched (a String),str (a String),position (a non-negativeinteger),captures (aList of either Strings orundefined),namedCaptures (an Object orundefined), andreplacementTemplate (a String) and returns either anormal completion containing a String or athrow completion. For the purposes of this abstract operation, adecimal digit is a code unit in theinclusive interval from 0x0030 (DIGIT ZERO) to 0x0039 (DIGIT NINE). It performs the following steps when called:

  1. LetstringLength be the length ofstr.
  2. Assert:positionstringLength.
  3. Letresult be the empty String.
  4. LettemplateRemainder bereplacementTemplate.
  5. Repeat, whiletemplateRemainder is not the empty String,
    1. NOTE: The following steps isolateref (a prefix oftemplateRemainder), determinerefReplacement (its replacement), and then append that replacement toresult.
    2. IftemplateRemainder starts with"$$", then
      1. Letref be"$$".
      2. LetrefReplacement be"$".
    3. Else iftemplateRemainder starts with"$`", then
      1. Letref be"$`".
      2. LetrefReplacement be thesubstring ofstr from 0 toposition.
    4. Else iftemplateRemainder starts with"$&", then
      1. Letref be"$&".
      2. LetrefReplacement bematched.
    5. Else iftemplateRemainder starts with"$'" (0x0024 (DOLLAR SIGN) followed by 0x0027 (APOSTROPHE)), then
      1. Letref be"$'".
      2. LetmatchLength be the length ofmatched.
      3. LettailPos beposition +matchLength.
      4. LetrefReplacement be thesubstring ofstr frommin(tailPos,stringLength).
      5. NOTE:tailPos can exceedstringLength only if this abstract operation was invoked by a call to the intrinsic%Symbol.replace% method of%RegExp.prototype% on an object whose"exec" property is not the intrinsic %RegExp.prototype.exec%.
    6. Else iftemplateRemainder starts with"$" followed by 1 or more decimal digits, then
      1. IftemplateRemainder starts with"$" followed by 2 or more decimal digits, letdigitCount be 2; otherwise letdigitCount be 1.
      2. Letdigits be thesubstring oftemplateRemainder from 1 to 1 +digitCount.
      3. Letindex be(StringToNumber(digits)).
      4. Assert: 0 ≤index ≤ 99.
      5. LetcaptureLen be the number of elements incaptures.
      6. Ifindex >captureLen anddigitCount = 2, then
        1. NOTE: When a two-digit replacement pattern specifies an index exceeding the count of capturing groups, it is treated as a one-digit replacement pattern followed by a literal digit.
        2. SetdigitCount to 1.
        3. Setdigits to thesubstring ofdigits from 0 to 1.
        4. Setindex to(StringToNumber(digits)).
      7. Letref be thesubstring oftemplateRemainder from 0 to 1 +digitCount.
      8. If 1 ≤indexcaptureLen, then
        1. Letcapture becaptures[index - 1].
        2. Ifcapture isundefined, then
          1. LetrefReplacement be the empty String.
        3. Else,
          1. LetrefReplacement becapture.
      9. Else,
        1. LetrefReplacement beref.
    7. Else iftemplateRemainder starts with"$<", then
      1. LetgtPos beStringIndexOf(templateRemainder,">", 0).
      2. IfgtPos isnot-found ornamedCaptures isundefined, then
        1. Letref be"$<".
        2. LetrefReplacement beref.
      3. Else,
        1. Letref be thesubstring oftemplateRemainder from 0 togtPos + 1.
        2. LetgroupName be thesubstring oftemplateRemainder from 2 togtPos.
        3. Assert:namedCapturesis an Object.
        4. Letcapture be ? Get(namedCaptures,groupName).
        5. Ifcapture isundefined, then
          1. LetrefReplacement be the empty String.
        6. Else,
          1. LetrefReplacement be ? ToString(capture).
    8. Else,
      1. Letref be thesubstring oftemplateRemainder from 0 to 1.
      2. LetrefReplacement beref.
    9. LetrefLength be the length ofref.
    10. SettemplateRemainder to thesubstring oftemplateRemainder fromrefLength.
    11. Setresult to thestring-concatenation ofresult andrefReplacement.
  6. Returnresult.

22.1.3.20 String.prototype.replaceAll (searchValue,replaceValue )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. IfsearchValue is neitherundefined nornull, then
    1. LetisRegExp be ? IsRegExp(searchValue).
    2. IfisRegExp istrue, then
      1. Letflags be ? Get(searchValue,"flags").
      2. Perform ? RequireObjectCoercible(flags).
      3. If ? ToString(flags) does not contain"g", throw aTypeError exception.
    3. Letreplacer be ? GetMethod(searchValue,%Symbol.replace%).
    4. Ifreplacer is notundefined, then
      1. Return ? Call(replacer,searchValue, «O,replaceValue »).
  4. Letstring be ? ToString(O).
  5. LetsearchString be ? ToString(searchValue).
  6. LetfunctionalReplace beIsCallable(replaceValue).
  7. IffunctionalReplace isfalse, then
    1. SetreplaceValue to ? ToString(replaceValue).
  8. LetsearchLength be the length ofsearchString.
  9. LetadvanceBy bemax(1,searchLength).
  10. LetmatchPositions be a new emptyList.
  11. Letposition beStringIndexOf(string,searchString, 0).
  12. Repeat, whileposition is notnot-found,
    1. Appendposition tomatchPositions.
    2. Setposition toStringIndexOf(string,searchString,position +advanceBy).
  13. LetendOfLastMatch be 0.
  14. Letresult be the empty String.
  15. For each elementp ofmatchPositions, do
    1. Letpreserved be thesubstring ofstring fromendOfLastMatch top.
    2. IffunctionalReplace istrue, then
      1. Letreplacement be ? ToString(?Call(replaceValue,undefined, «searchString,𝔽(p),string »)).
    3. Else,
      1. Assert:replaceValueis a String.
      2. Letcaptures be a new emptyList.
      3. Letreplacement be ! GetSubstitution(searchString,string,p,captures,undefined,replaceValue).
    4. Setresult to thestring-concatenation ofresult,preserved, andreplacement.
    5. SetendOfLastMatch top +searchLength.
  16. IfendOfLastMatch < the length ofstring, then
    1. Setresult to thestring-concatenation ofresult and thesubstring ofstring fromendOfLastMatch.
  17. Returnresult.

22.1.3.21 String.prototype.search (regexp )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Ifregexp is neitherundefined nornull, then
    1. Letsearcher be ? GetMethod(regexp,%Symbol.search%).
    2. Ifsearcher is notundefined, then
      1. Return ? Call(searcher,regexp, «O »).
  4. Letstring be ? ToString(O).
  5. Letrx be ? RegExpCreate(regexp,undefined).
  6. Return ? Invoke(rx,%Symbol.search%, «string »).
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.22 String.prototype.slice (start,end )

This method returns asubstring of the result of converting this object to a String, starting from indexstart and running to, but not including, indexend (or through the end of the String ifend isundefined). Ifstart is negative, it is treated assourceLength +start wheresourceLength is the length of the String. Ifend is negative, it is treated assourceLength +end wheresourceLength is the length of the String. The resultis a String value, not a String object.

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letlen be the length ofS.
  5. LetintStart be ? ToIntegerOrInfinity(start).
  6. IfintStart = -∞, letfrom be 0.
  7. Else ifintStart < 0, letfrom bemax(len +intStart, 0).
  8. Else, letfrom bemin(intStart,len).
  9. Ifend isundefined, letintEnd belen; else letintEnd be ? ToIntegerOrInfinity(end).
  10. IfintEnd = -∞, letto be 0.
  11. Else ifintEnd < 0, letto bemax(len +intEnd, 0).
  12. Else, letto bemin(intEnd,len).
  13. Iffromto, return the empty String.
  14. Return thesubstring ofS fromfrom toto.
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.

22.1.3.23 String.prototype.split (separator,limit )

This method returns an Array into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences ofseparator; these occurrences are not part of any String in the returned array, but serve to divide up the String value. The value ofseparator may be a String of any length or it may be an object, such as a RegExp, that has a%Symbol.split% method.

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Ifseparator is neitherundefined nornull, then
    1. Letsplitter be ? GetMethod(separator,%Symbol.split%).
    2. Ifsplitter is notundefined, then
      1. Return ? Call(splitter,separator, «O,limit »).
  4. LetS be ? ToString(O).
  5. Iflimit isundefined, letlim be 232 - 1; else letlim be(?ToUint32(limit)).
  6. LetR be ? ToString(separator).
  7. Iflim = 0, then
    1. ReturnCreateArrayFromList(« »).
  8. Ifseparator isundefined, then
    1. ReturnCreateArrayFromListS »).
  9. LetseparatorLength be the length ofR.
  10. IfseparatorLength = 0, then
    1. LetstrLen be the length ofS.
    2. LetoutLen be the result ofclampinglim between 0 andstrLen.
    3. Lethead be thesubstring ofS from 0 tooutLen.
    4. LetcodeUnits be aList consisting of the sequence of code units that are the elements ofhead.
    5. ReturnCreateArrayFromList(codeUnits).
  11. IfS is the empty String, returnCreateArrayFromListS »).
  12. Letsubstrings be a new emptyList.
  13. Leti be 0.
  14. Letj beStringIndexOf(S,R, 0).
  15. Repeat, whilej is notnot-found,
    1. LetT be thesubstring ofS fromi toj.
    2. AppendT tosubstrings.
    3. If the number of elements insubstrings islim, returnCreateArrayFromList(substrings).
    4. Seti toj +separatorLength.
    5. Setj toStringIndexOf(S,R,i).
  16. LetT be thesubstring ofS fromi.
  17. AppendT tosubstrings.
  18. ReturnCreateArrayFromList(substrings).
Note 1

The value ofseparator may be an empty String. In this case,separator does not match the emptysubstring at the beginning or end of the input String, nor does it match the emptysubstring at the end of the previous separator match. Ifseparator is the empty String, the String is split up into individual code unit elements; the length of the result array equals the length of the String, and eachsubstring contains one code unit.

If thethis value is (or converts to) the empty String, the result depends on whetherseparator can match the empty String. If it can, the result array contains no elements. Otherwise, the result array contains one element, which is the empty String.

Ifseparator isundefined, then the result array contains just one String, which is thethis value (converted to a String). Iflimit is notundefined, then the output array is truncated so that it contains no more thanlimit elements.

Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.24 String.prototype.startsWith (searchString [ ,position ] )

This method performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetisRegExp be ? IsRegExp(searchString).
  5. IfisRegExp istrue, throw aTypeError exception.
  6. LetsearchStr be ? ToString(searchString).
  7. Letlen be the length ofS.
  8. Ifposition isundefined, letpos be 0; else letpos be ? ToIntegerOrInfinity(position).
  9. Letstart be the result ofclampingpos between 0 andlen.
  10. LetsearchLength be the length ofsearchStr.
  11. IfsearchLength = 0, returntrue.
  12. Letend bestart +searchLength.
  13. Ifend >len, returnfalse.
  14. Letsubstring be thesubstring ofS fromstart toend.
  15. Ifsubstring issearchStr, returntrue.
  16. Returnfalse.
Note 1

This method returnstrue if the sequence of code units ofsearchString converted to a String is the same as the corresponding code units of this object (converted to a String) starting at indexposition. Otherwise it returnsfalse.

Note 2

Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.

Note 3

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.25 String.prototype.substring (start,end )

This method returns asubstring of the result of converting this object to a String, starting from indexstart and running to, but not including, indexend of the String (or through the end of the String ifend isundefined). The resultis a String value, not a String object.

If either argument isNaN or negative, it is replaced with zero; if either argument is strictly greater than the length of the String, it is replaced with the length of the String.

Ifstart is strictly greater thanend, they are swapped.

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. Letlen be the length ofS.
  5. LetintStart be ? ToIntegerOrInfinity(start).
  6. Ifend isundefined, letintEnd belen; else letintEnd be ? ToIntegerOrInfinity(end).
  7. LetfinalStart be the result ofclampingintStart between 0 andlen.
  8. LetfinalEnd be the result ofclampingintEnd between 0 andlen.
  9. Letfrom bemin(finalStart,finalEnd).
  10. Letto bemax(finalStart,finalEnd).
  11. Return thesubstring ofS fromfrom toto.
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.26 String.prototype.toLocaleLowerCase ( [reserved1 [ ,reserved2 ] ] )

An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It works exactly the same astoLowerCase except that it is intended to yield a locale-sensitive result corresponding with conventions of thehost environment's current locale. There will only be a difference in the few cases (such as Turkish) where the rules for that language conflict with the regular Unicode case mappings.

The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.27 String.prototype.toLocaleUpperCase ( [reserved1 [ ,reserved2 ] ] )

An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It works exactly the same astoUpperCase except that it is intended to yield a locale-sensitive result corresponding with conventions of thehost environment's current locale. There will only be a difference in the few cases (such as Turkish) where the rules for that language conflict with the regular Unicode case mappings.

The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.28 String.prototype.toLowerCase ( )

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetsText beStringToCodePoints(S).
  5. LetlowerText be toLowercase(sText), according to the Unicode Default Case Conversion algorithm.
  6. LetL beCodePointsToString(lowerText).
  7. ReturnL.

The result must be derived according to the locale-insensitive case mappings in the Unicode Character Database (this explicitly includes not only the fileUnicodeData.txt, but also all locale-insensitive mappings in the fileSpecialCasing.txt that accompanies it).

Note 1

The case mapping of some code points may produce multiple code points. In this case the result String may not be the same length as the source String. Because bothtoUpperCase andtoLowerCase have context-sensitive behaviour, the methods are not symmetrical. In other words,s.toUpperCase().toLowerCase() is not necessarily equal tos.toLowerCase().

Note 2

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.29 String.prototype.toString ( )

This method performs the following steps when called:

  1. Return ? ThisStringValue(this value).
Note

For a String object, this method happens to return the same thing as thevalueOf method.

22.1.3.30 String.prototype.toUpperCase ( )

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It behaves in exactly the same way asString.prototype.toLowerCase, except that the String is mapped using the toUppercase algorithm of the Unicode Default Case Conversion.

Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.31 String.prototype.toWellFormed ( )

This method returns a String representation of this object with allleading surrogates andtrailing surrogates that are not part of asurrogate pair replaced with U+FFFD (REPLACEMENT CHARACTER).

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. LetS be ? ToString(O).
  4. LetstrLen be the length ofS.
  5. Letk be 0.
  6. Letresult be the empty String.
  7. Repeat, whilek <strLen,
    1. Letcp beCodePointAt(S,k).
    2. Ifcp.[[IsUnpairedSurrogate]] istrue, then
      1. Setresult to thestring-concatenation ofresult and 0xFFFD (REPLACEMENT CHARACTER).
    3. Else,
      1. Setresult to thestring-concatenation ofresult andUTF16EncodeCodePoint(cp.[[CodePoint]]).
    4. Setk tok +cp.[[CodeUnitCount]].
  8. Returnresult.

22.1.3.32 String.prototype.trim ( )

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It performs the following steps when called:

  1. LetS be thethis value.
  2. Return ? TrimString(S,start+end).
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.32.1 TrimString (string,where )

The abstract operation TrimString takes argumentsstring (anECMAScript language value) andwhere (start,end, orstart+end) and returns either anormal completion containing a String or athrow completion. It interpretsstring as a sequence of UTF-16 encoded code points, as described in6.1.4. It performs the following steps when called:

  1. Perform ? RequireObjectCoercible(string).
  2. LetS be ? ToString(string).
  3. Ifwhere isstart, then
    1. LetT be the String value that is a copy ofS with leading white space removed.
  4. Else ifwhere isend, then
    1. LetT be the String value that is a copy ofS with trailing white space removed.
  5. Else,
    1. Assert:where isstart+end.
    2. LetT be the String value that is a copy ofS with both leading and trailing white space removed.
  6. ReturnT.

The definition of white space is the union ofWhiteSpace andLineTerminator. When determining whether a Unicode code point is in Unicode general category “Space_Separator” (“Zs”), code unit sequences are interpreted as UTF-16 encoded code point sequences as specified in6.1.4.

22.1.3.33 String.prototype.trimEnd ( )

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It performs the following steps when called:

  1. LetS be thethis value.
  2. Return ? TrimString(S,end).
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.34 String.prototype.trimStart ( )

This method interprets a String value as a sequence of UTF-16 encoded code points, as described in6.1.4.

It performs the following steps when called:

  1. LetS be thethis value.
  2. Return ? TrimString(S,start).
Note

This method is intentionally generic; it does not require that itsthis value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

22.1.3.35 String.prototype.valueOf ( )

This method performs the following steps when called:

  1. Return ? ThisStringValue(this value).

22.1.3.35.1 ThisStringValue (value )

The abstract operation ThisStringValue takes argumentvalue (anECMAScript language value) and returns either anormal completion containing a String or athrow completion. It performs the following steps when called:

  1. Ifvalueis a String, returnvalue.
  2. Ifvalueis an Object andvalue has a[[StringData]] internal slot, then
    1. Lets bevalue.[[StringData]].
    2. Assert:sis a String.
    3. Returns.
  3. Throw aTypeError exception.

22.1.3.36 String.prototype [ %Symbol.iterator% ] ( )

This method returns aniterator object that iterates over the code points of a String value, returning each code point as a String value.

It performs the following steps when called:

  1. LetO be thethis value.
  2. Perform ? RequireObjectCoercible(O).
  3. Lets be ? ToString(O).
  4. Letclosure be a newAbstract Closure with no parameters that capturess and performs the following steps when called:
    1. Letlen be the length ofs.
    2. Letposition be 0.
    3. Repeat, whileposition <len,
      1. Letcp beCodePointAt(s,position).
      2. LetnextIndex beposition +cp.[[CodeUnitCount]].
      3. LetresultString be thesubstring ofs fromposition tonextIndex.
      4. Setposition tonextIndex.
      5. Perform ? GeneratorYield(CreateIteratorResultObject(resultString,false)).
    4. ReturnNormalCompletion(unused).
  5. ReturnCreateIteratorFromClosure(closure,"%StringIteratorPrototype%",%StringIteratorPrototype%).

The value of the"name" property of this method is"[Symbol.iterator]".

22.1.4 Properties of String Instances

String instances areString exotic objects and have the internal methods specified for such objects. String instances inherit properties from theString prototype object. String instances also have a[[StringData]] internal slot. The[[StringData]] internal slot is the String value represented by this String object.

String instances have a"length" property, and a set of enumerable properties withinteger-indexed names.

22.1.4.1 length

The number of elements in the String value represented by this String object.

Once a String object is initialized, this property is unchanging. It has the attributes {[[Writable]]:false,[[Enumerable]]:false,[[Configurable]]:false }.

22.1.5 String Iterator Objects

AString Iterator is an object that represents a specific iteration over some specific String instance object. There is not a namedconstructor for String Iterator objects. Instead, String Iterator objects are created by calling certain methods of String instance objects.

22.1.5.1 The %StringIteratorPrototype% Object

The%StringIteratorPrototype% object:

22.1.5.1.1 %StringIteratorPrototype%.next ( )

  1. Return ? GeneratorResume(this value,empty,"%StringIteratorPrototype%").

22.1.5.1.2 %StringIteratorPrototype% [ %Symbol.toStringTag% ]

The initial value of the%Symbol.toStringTag% property is the String value"String Iterator".

This property has the attributes {[[Writable]]:false,[[Enumerable]]:false,[[Configurable]]:true }.

22.2 RegExp (Regular Expression) Objects

A RegExp object contains a regular expression and the associated flags.

Note

The form and functionality of regular expressions is modelled after the regular expression facility in the Perl 5 programming language.

22.2.1 Patterns

The RegExpconstructor applies the following grammar to the input pattern String. An error occurs if the grammar cannot interpret the String as an expansion ofPattern.

Syntax

Pattern[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]::Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Disjunction[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]::Alternative[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Alternative[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]|Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Alternative[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]::[empty]Alternative[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Term[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Term[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]::Assertion[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Atom[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]Atom[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]QuantifierAssertion[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]::^$\b\B(?=Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])(?!Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])(?<=Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])(?<!Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])Quantifier::QuantifierPrefixQuantifierPrefix?QuantifierPrefix::*+?{DecimalDigits[~Sep]}{DecimalDigits[~Sep],}{DecimalDigits[~Sep],DecimalDigits[~Sep]}Atom[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]::PatternCharacter.\AtomEscape[?UnicodeMode, ?NamedCaptureGroups]CharacterClass[?UnicodeMode, ?UnicodeSetsMode](GroupSpecifier[?UnicodeMode]optDisjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])(?RegularExpressionModifiers:Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])(?RegularExpressionModifiers-RegularExpressionModifiers:Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups])RegularExpressionModifiers::[empty]RegularExpressionModifiersRegularExpressionModifierRegularExpressionModifier::one ofimsSyntaxCharacter::one of^$\.*+?()[]{}|PatternCharacter::SourceCharacterbut notSyntaxCharacterAtomEscape[UnicodeMode, NamedCaptureGroups]::DecimalEscapeCharacterClassEscape[?UnicodeMode]CharacterEscape[?UnicodeMode][+NamedCaptureGroups]kGroupName[?UnicodeMode]CharacterEscape[UnicodeMode]::ControlEscapecAsciiLetter0[lookahead ∉DecimalDigit]HexEscapeSequenceRegExpUnicodeEscapeSequence[?UnicodeMode]IdentityEscape[?UnicodeMode]ControlEscape::one offnrtvGroupSpecifier[UnicodeMode]::?GroupName[?UnicodeMode]GroupName[UnicodeMode]::<RegExpIdentifierName[?UnicodeMode]>RegExpIdentifierName[UnicodeMode]::RegExpIdentifierStart[?UnicodeMode]RegExpIdentifierName[?UnicodeMode]RegExpIdentifierPart[?UnicodeMode]RegExpIdentifierStart[UnicodeMode]::IdentifierStartChar\RegExpUnicodeEscapeSequence[+UnicodeMode][~UnicodeMode]UnicodeLeadSurrogateUnicodeTrailSurrogateRegExpIdentifierPart[UnicodeMode]::IdentifierPartChar\RegExpUnicodeEscapeSequence[+UnicodeMode][~UnicodeMode]UnicodeLeadSurrogateUnicodeTrailSurrogateRegExpUnicodeEscapeSequence[UnicodeMode]::[+UnicodeMode]uHexLeadSurrogate\uHexTrailSurrogate[+UnicodeMode]uHexLeadSurrogate[+UnicodeMode]uHexTrailSurrogate[+UnicodeMode]uHexNonSurrogate[~UnicodeMode]uHex4Digits[+UnicodeMode]u{CodePoint}UnicodeLeadSurrogate::any Unicode code point in the inclusive interval from U+D800 to U+DBFFUnicodeTrailSurrogate::any Unicode code point in the inclusive interval from U+DC00 to U+DFFF

Each\uHexTrailSurrogate for which the choice of associateduHexLeadSurrogate is ambiguous shall be associated with the nearest possibleuHexLeadSurrogate that would otherwise have no corresponding\uHexTrailSurrogate.

HexLeadSurrogate::Hex4Digitsbut only if the MV ofHex4Digits is in theinclusive interval from 0xD800 to 0xDBFFHexTrailSurrogate::Hex4Digitsbut only if the MV ofHex4Digits is in theinclusive interval from 0xDC00 to 0xDFFFHexNonSurrogate::Hex4Digitsbut only if the MV ofHex4Digits is not in theinclusive interval from 0xD800 to 0xDFFFIdentityEscape[UnicodeMode]::[+UnicodeMode]SyntaxCharacter[+UnicodeMode]/[~UnicodeMode]SourceCharacterbut notUnicodeIDContinueDecimalEscape::NonZeroDigitDecimalDigits[~Sep]opt[lookahead ∉DecimalDigit]CharacterClassEscape[UnicodeMode]::dDsSwW[+UnicodeMode]p{UnicodePropertyValueExpression}[+UnicodeMode]P{UnicodePropertyValueExpression}UnicodePropertyValueExpression::UnicodePropertyName=UnicodePropertyValueLoneUnicodePropertyNameOrValueUnicodePropertyName::UnicodePropertyNameCharactersUnicodePropertyNameCharacters::UnicodePropertyNameCharacterUnicodePropertyNameCharactersoptUnicodePropertyValue::UnicodePropertyValueCharactersLoneUnicodePropertyNameOrValue::UnicodePropertyValueCharactersUnicodePropertyValueCharacters::UnicodePropertyValueCharacterUnicodePropertyValueCharactersoptUnicodePropertyValueCharacter::UnicodePropertyNameCharacterDecimalDigitUnicodePropertyNameCharacter::AsciiLetter_CharacterClass[UnicodeMode, UnicodeSetsMode]::[[lookahead ≠^]ClassContents[?UnicodeMode, ?UnicodeSetsMode]][^ClassContents[?UnicodeMode, ?UnicodeSetsMode]]ClassContents[UnicodeMode, UnicodeSetsMode]::[empty][~UnicodeSetsMode]NonemptyClassRanges[?UnicodeMode][+UnicodeSetsMode]ClassSetExpressionNonemptyClassRanges[UnicodeMode]::ClassAtom[?UnicodeMode]ClassAtom[?UnicodeMode]NonemptyClassRangesNoDash[?UnicodeMode]ClassAtom[?UnicodeMode]-ClassAtom[?UnicodeMode]ClassContents[?UnicodeMode, ~UnicodeSetsMode]NonemptyClassRangesNoDash[UnicodeMode]::ClassAtom[?UnicodeMode]ClassAtomNoDash[?UnicodeMode]NonemptyClassRangesNoDash[?UnicodeMode]ClassAtomNoDash[?UnicodeMode]-ClassAtom[?UnicodeMode]ClassContents[?UnicodeMode, ~UnicodeSetsMode]ClassAtom[UnicodeMode]::-ClassAtomNoDash[?UnicodeMode]ClassAtomNoDash[UnicodeMode]::SourceCharacterbut not one of\ or] or-\ClassEscape[?UnicodeMode]ClassEscape[UnicodeMode]::b[+UnicodeMode]-CharacterClassEscape[?UnicodeMode]CharacterEscape[?UnicodeMode]ClassSetExpression::ClassUnionClassIntersectionClassSubtractionClassUnion::ClassSetRangeClassUnionoptClassSetOperandClassUnionoptClassIntersection::ClassSetOperand&&[lookahead ≠&]ClassSetOperandClassIntersection&&[lookahead ≠&]ClassSetOperandClassSubtraction::ClassSetOperand--ClassSetOperandClassSubtraction--ClassSetOperandClassSetRange::ClassSetCharacter-ClassSetCharacterClassSetOperand::NestedClassClassStringDisjunctionClassSetCharacterNestedClass::[[lookahead ≠^]ClassContents[+UnicodeMode, +UnicodeSetsMode]][^ClassContents[+UnicodeMode, +UnicodeSetsMode]]\CharacterClassEscape[+UnicodeMode]Note 1

The first two lines here are equivalent to CharacterClass.

ClassStringDisjunction::\q{ClassStringDisjunctionContents}ClassStringDisjunctionContents::ClassStringClassString|ClassStringDisjunctionContentsClassString::[empty]NonEmptyClassStringNonEmptyClassString::ClassSetCharacterNonEmptyClassStringoptClassSetCharacter::[lookahead ∉ClassSetReservedDoublePunctuator]SourceCharacterbut notClassSetSyntaxCharacter\CharacterEscape[+UnicodeMode]\ClassSetReservedPunctuator\bClassSetReservedDoublePunctuator::one of&&!!##$$%%**++,,..::;;<<==>>??@@^^``~~ClassSetSyntaxCharacter::one of()[]{}/-\|ClassSetReservedPunctuator::one of&-!#%,:;<=>@`~Note 2

A number of productions in this section are given alternative definitions in sectionB.1.2.

22.2.1.1 Static Semantics: Early Errors

Note

This section is amended inB.1.2.1.

Pattern::DisjunctionQuantifierPrefix::{DecimalDigits,DecimalDigits}Atom::(?RegularExpressionModifiers:Disjunction)Atom::(?RegularExpressionModifiers-RegularExpressionModifiers:Disjunction)AtomEscape::kGroupNameAtomEscape::DecimalEscapeNonemptyClassRanges::ClassAtom-ClassAtomClassContentsNonemptyClassRangesNoDash::ClassAtomNoDash-ClassAtomClassContentsRegExpIdentifierStart::\RegExpUnicodeEscapeSequenceRegExpIdentifierStart::UnicodeLeadSurrogateUnicodeTrailSurrogateRegExpIdentifierPart::\RegExpUnicodeEscapeSequenceRegExpIdentifierPart::UnicodeLeadSurrogateUnicodeTrailSurrogateUnicodePropertyValueExpression::UnicodePropertyName=UnicodePropertyValueUnicodePropertyValueExpression::LoneUnicodePropertyNameOrValueCharacterClassEscape::P{UnicodePropertyValueExpression}CharacterClass::[^ClassContents]NestedClass::[^ClassContents]ClassSetRange::ClassSetCharacter-ClassSetCharacter

22.2.1.2 Static Semantics: CountLeftCapturingParensWithin (node )

The abstract operation CountLeftCapturingParensWithin takes argumentnode (aParse Node) and returns a non-negativeinteger. It returns the number of left-capturing parentheses innode. Aleft-capturing parenthesis is any( pattern character that is matched by the( terminal of theAtom::(GroupSpecifieroptDisjunction) production.

Note

This section is amended inB.1.2.2.

It performs the following steps when called:

  1. Assert:node is an instance of a production inthe RegExp Pattern grammar.
  2. Return the number ofAtom::(GroupSpecifieroptDisjunction)Parse Nodes contained withinnode.

22.2.1.3 Static Semantics: CountLeftCapturingParensBefore (node )

The abstract operation CountLeftCapturingParensBefore takes argumentnode (aParse Node) and returns a non-negativeinteger. It returns the number ofleft-capturing parentheses within the enclosing pattern that occur to the left ofnode.

Note

This section is amended inB.1.2.2.

It performs the following steps when called:

  1. Assert:node is an instance of a production inthe RegExp Pattern grammar.
  2. Letpattern be thePattern containingnode.
  3. Return the number ofAtom::(GroupSpecifieroptDisjunction)Parse Nodes contained withinpattern that either occur beforenode or containnode.

22.2.1.4 Static Semantics: MightBothParticipate (x,y )

The abstract operation MightBothParticipate takes argumentsx (aParse Node) andy (aParse Node) and returns a Boolean. It performs the following steps when called:

  1. Assert:x andy have the same enclosingPattern.
  2. If the enclosingPattern contains aDisjunction::Alternative|DisjunctionParse Node such that eitherx is contained within theAlternative andy is contained within the derivedDisjunction, orx is contained within the derivedDisjunction andy is contained within theAlternative, returnfalse.
  3. Returntrue.

22.2.1.5 Static Semantics: CapturingGroupNumber

Thesyntax-directed operation CapturingGroupNumber takes no arguments and returns a positiveinteger.

Note

This section is amended inB.1.2.1.

It is defined piecewise over the following productions:

DecimalEscape::NonZeroDigit
  1. Return the MV ofNonZeroDigit.
DecimalEscape::NonZeroDigitDecimalDigits
  1. Letn be the number of code points inDecimalDigits.
  2. Return (the MV ofNonZeroDigit × 10n plus the MV ofDecimalDigits).

The definitions of “the MV ofNonZeroDigit” and “the MV ofDecimalDigits” are in12.9.3.

22.2.1.6 Static Semantics: IsCharacterClass

Thesyntax-directed operation IsCharacterClass takes no arguments and returns a Boolean.

Note

This section is amended inB.1.2.3.

It is defined piecewise over the following productions:

ClassAtom::-ClassAtomNoDash::SourceCharacterbut not one of\ or] or-ClassEscape::b-CharacterEscape
  1. Returnfalse.
ClassEscape::CharacterClassEscape
  1. Returntrue.

22.2.1.7 Static Semantics: CharacterValue

Thesyntax-directed operation CharacterValue takes no arguments and returns a non-negativeinteger.

Note 1

This section is amended inB.1.2.4.

It is defined piecewise over the following productions:

ClassAtom::-
  1. Return the numeric value of U+002D (HYPHEN-MINUS).
ClassAtomNoDash::SourceCharacterbut not one of\ or] or-
  1. Letch be the code point matched bySourceCharacter.
  2. Return the numeric value ofch.
ClassEscape::b
  1. Return the numeric value of U+0008 (BACKSPACE).
ClassEscape::-
  1. Return the numeric value of U+002D (HYPHEN-MINUS).
CharacterEscape::ControlEscape
  1. Return the numeric value according toTable 65.
Table 65: ControlEscape Code Point Values
ControlEscape Numeric Value Code Point Unicode Name Symbol
t 9U+0009 CHARACTER TABULATION <HT>
n 10U+000A LINE FEED (LF) <LF>
v 11U+000B LINE TABULATION <VT>
f 12U+000C FORM FEED (FF) <FF>
r 13U+000D CARRIAGE RETURN (CR) <CR>
CharacterEscape::cAsciiLetter
  1. Letch be the code point matched byAsciiLetter.
  2. Leti be the numeric value ofch.
  3. Return the remainder of dividingi by 32.
CharacterEscape::0[lookahead ∉DecimalDigit]
  1. Return the numeric value of U+0000 (NULL).
Note 2

\0 represents the <NUL> character and cannot be followed by a decimal digit.

CharacterEscape::HexEscapeSequence
  1. Return the MV ofHexEscapeSequence.
RegExpUnicodeEscapeSequence::uHexLeadSurrogate\uHexTrailSurrogate
  1. Letlead be theCharacterValue ofHexLeadSurrogate.
  2. Lettrail be theCharacterValue ofHexTrailSurrogate.
  3. Letcp beUTF16SurrogatePairToCodePoint(lead,trail).
  4. Return the numeric value ofcp.
RegExpUnicodeEscapeSequence::uHex4Digits
  1. Return the MV ofHex4Digits.
RegExpUnicodeEscapeSequence::u{CodePoint}
  1. Return the MV ofCodePoint.
HexLeadSurrogate::Hex4DigitsHexTrailSurrogate::Hex4DigitsHexNonSurrogate::Hex4Digits
  1. Return the MV ofHex4Digits.
CharacterEscape::IdentityEscape
  1. Letch be the code point matched byIdentityEscape.
  2. Return the numeric value ofch.
ClassSetCharacter::SourceCharacterbut notClassSetSyntaxCharacter
  1. Letch be the code point matched bySourceCharacter.
  2. Return the numeric value ofch.
ClassSetCharacter::\ClassSetReservedPunctuator
  1. Letch be the code point matched byClassSetReservedPunctuator.
  2. Return the numeric value ofch.
ClassSetCharacter::\b
  1. Return the numeric value of U+0008 (BACKSPACE).

22.2.1.8 Static Semantics: MayContainStrings

Thesyntax-directed operation MayContainStrings takes no arguments and returns a Boolean. It is defined piecewise over the following productions:

CharacterClassEscape::dDsSwWP{UnicodePropertyValueExpression}UnicodePropertyValueExpression::UnicodePropertyName=UnicodePropertyValueNestedClass::[^ClassContents]ClassContents::[empty]NonemptyClassRangesClassSetOperand::ClassSetCharacter
  1. Returnfalse.
UnicodePropertyValueExpression::LoneUnicodePropertyNameOrValue
  1. If thesource text matched byLoneUnicodePropertyNameOrValue is a binary property of strings listed in the “Property name” column ofTable 69, returntrue.
  2. Returnfalse.
ClassUnion::ClassSetRangeClassUnionopt
  1. If theClassUnion is present, returnMayContainStrings of theClassUnion.
  2. Returnfalse.
ClassUnion::ClassSetOperandClassUnionopt
  1. IfMayContainStrings of theClassSetOperand istrue, returntrue.
  2. IfClassUnion is present, returnMayContainStrings of theClassUnion.
  3. Returnfalse.
ClassIntersection::ClassSetOperand&&ClassSetOperand
  1. IfMayContainStrings of the firstClassSetOperand isfalse, returnfalse.
  2. IfMayContainStrings of the secondClassSetOperand isfalse, returnfalse.
  3. Returntrue.
ClassIntersection::ClassIntersection&&ClassSetOperand
  1. IfMayContainStrings of theClassIntersection isfalse, returnfalse.
  2. IfMayContainStrings of theClassSetOperand isfalse, returnfalse.
  3. Returntrue.
ClassSubtraction::ClassSetOperand--ClassSetOperand
  1. ReturnMayContainStrings of the firstClassSetOperand.
ClassSubtraction::ClassSubtraction--ClassSetOperand
  1. ReturnMayContainStrings of theClassSubtraction.
ClassStringDisjunctionContents::ClassString|ClassStringDisjunctionContents
  1. IfMayContainStrings of theClassString istrue, returntrue.
  2. ReturnMayContainStrings of theClassStringDisjunctionContents.
ClassString::[empty]
  1. Returntrue.
ClassString::NonEmptyClassString
  1. ReturnMayContainStrings of theNonEmptyClassString.
NonEmptyClassString::ClassSetCharacterNonEmptyClassStringopt
  1. IfNonEmptyClassString is present, returntrue.
  2. Returnfalse.

22.2.1.9 Static Semantics: GroupSpecifiersThatMatch (thisGroupName )

The abstract operation GroupSpecifiersThatMatch takes argumentthisGroupName (aGroupNameParse Node) and returns aList ofGroupSpecifierParse Nodes. It performs the following steps when called:

  1. Letname be theCapturingGroupName ofthisGroupName.
  2. Letpattern be thePattern containingthisGroupName.
  3. Letresult be a new emptyList.
  4. For eachGroupSpecifiergs thatpattern contains, do
    1. If theCapturingGroupName ofgs isname, then
      1. Appendgs toresult.
  5. Returnresult.

22.2.1.10 Static Semantics: CapturingGroupName

Thesyntax-directed operation CapturingGroupName takes no arguments and returns a String. It is defined piecewise over the following productions:

GroupName::<RegExpIdentifierName>
  1. LetidTextUnescaped be theRegExpIdentifierCodePoints ofRegExpIdentifierName.
  2. ReturnCodePointsToString(idTextUnescaped).

22.2.1.11 Static Semantics: RegExpIdentifierCodePoints

Thesyntax-directed operation RegExpIdentifierCodePoints takes no arguments and returns aList of code points. It is defined piecewise over the following productions:

RegExpIdentifierName::RegExpIdentifierStart
  1. Letcp be theRegExpIdentifierCodePoint ofRegExpIdentifierStart.
  2. Return «cp ».
RegExpIdentifierName::RegExpIdentifierNameRegExpIdentifierPart
  1. Letcps be theRegExpIdentifierCodePoints of the derivedRegExpIdentifierName.
  2. Letcp be theRegExpIdentifierCodePoint ofRegExpIdentifierPart.
  3. Return thelist-concatenation ofcps and «cp ».

22.2.1.12 Static Semantics: RegExpIdentifierCodePoint

Thesyntax-directed operation RegExpIdentifierCodePoint takes no arguments and returns a code point. It is defined piecewise over the following productions:

RegExpIdentifierStart::IdentifierStartChar
  1. Return the code point matched byIdentifierStartChar.
RegExpIdentifierPart::IdentifierPartChar
  1. Return the code point matched byIdentifierPartChar.
RegExpIdentifierStart::\RegExpUnicodeEscapeSequenceRegExpIdentifierPart::\RegExpUnicodeEscapeSequence
  1. Return the code point whose numeric value is theCharacterValue ofRegExpUnicodeEscapeSequence.
RegExpIdentifierStart::UnicodeLeadSurrogateUnicodeTrailSurrogateRegExpIdentifierPart::UnicodeLeadSurrogateUnicodeTrailSurrogate
  1. Letlead be the code unit whose numeric value is the numeric value of the code point matched byUnicodeLeadSurrogate.
  2. Lettrail be the code unit whose numeric value is the numeric value of the code point matched byUnicodeTrailSurrogate.
  3. ReturnUTF16SurrogatePairToCodePoint(lead,trail).

22.2.2 Pattern Semantics

A regular expression pattern is converted into anAbstract Closure using the process described below. An implementation is encouraged to use more efficient algorithms than the ones listed below, as long as the results are the same. TheAbstract Closure is used as the value of a RegExp object's[[RegExpMatcher]] internal slot.

APattern is a BMP pattern if its associated flags contain neither au nor av. Otherwise, it is a Unicode pattern. A BMP pattern matches against a String interpreted as consisting of a sequence of 16-bit values that are Unicode code points in the range of the Basic Multilingual Plane. A Unicode pattern matches against a String interpreted as consisting of Unicode code points encoded using UTF-16. In the context of describing the behaviour of a BMP pattern “character” means a single 16-bit Unicode BMP code point. In the context of describing the behaviour of a Unicode pattern “character” means a UTF-16 encoded code point (6.1.4). In either context, “character value” means the numeric value of the corresponding non-encoded code point.

The syntax and semantics ofPattern is defined as if the source text for thePattern was aList ofSourceCharacter values where eachSourceCharacter corresponds to a Unicode code point. If a BMP pattern contains a non-BMPSourceCharacter the entire pattern is encoded using UTF-16 and the individual code units of that encoding are used as the elements of theList.

Note

For example, consider a pattern expressed in source text as the single non-BMP character U+1D11E (MUSICAL SYMBOL G CLEF). Interpreted as a Unicode pattern, it would be a single element (character)List consisting of the single code point U+1D11E. However, interpreted as a BMP pattern, it is first UTF-16 encoded to produce a two elementList consisting of the code units 0xD834 and 0xDD1E.

Patterns are passed to the RegExpconstructor as ECMAScript String values in which non-BMP characters are UTF-16 encoded. For example, the single character MUSICAL SYMBOL G CLEF pattern, expressed as a String value,is a String of length 2 whose elements were the code units 0xD834 and 0xDD1E. So no further translation of the string would be necessary to process it as a BMP pattern consisting of two pattern characters. However, to process it as a Unicode patternUTF16SurrogatePairToCodePoint must be used in producing aList whose sole element is a single pattern character, the code point U+1D11E.

An implementation may not actually perform such translations to or from UTF-16, but the semantics of this specification requires that the result of pattern matching be as if such translations were performed.

22.2.2.1 Notation

The descriptions below use the following internal data structures:

  • ACharSetElement is one of the two following entities:
    • Ifrer.[[UnicodeSets]] isfalse, then a CharSetElement is a character in the sense of the Pattern Semantics above.
    • Ifrer.[[UnicodeSets]] istrue, then a CharSetElement is a sequence whose elements are characters in the sense of the Pattern Semantics above. This includes the empty sequence, sequences of one character, and sequences of more than one character. For convenience, when working with CharSetElements of this kind, an individual character is treated interchangeably with a sequence of one character.
  • ACharSet is a mathematical set of CharSetElements.
  • ACaptureRange is aRecord {[[StartIndex]],[[EndIndex]] } that represents the range of characters included in a capture, where[[StartIndex]] is aninteger representing the start index (inclusive) of the range withinInput, and[[EndIndex]] is aninteger representing the end index (exclusive) of the range withinInput. For anyCaptureRange, these indices must satisfy the invariant that[[StartIndex]][[EndIndex]].
  • AMatchState is aRecord {[[Input]],[[EndIndex]],[[Captures]] } where[[Input]] is aList of characters representing the String being matched,[[EndIndex]] is aninteger, and[[Captures]] is aList of values, one for eachleft-capturing parenthesis in the pattern.MatchStates are used to represent partial match states in the regular expression matching algorithms. The[[EndIndex]] is one plus the index of the last input character matched so far by the pattern, while[[Captures]] holds the results of capturing parentheses. Thenth element of[[Captures]] is either aCaptureRange representing the range of characters captured by thenth set of capturing parentheses, orundefined if thenth set of capturing parentheses hasn't been reached yet. Due to backtracking, manyMatchStates may be in use at any time during the matching process.
  • AMatcherContinuation is anAbstract Closure that takes oneMatchState argument and returns either aMatchState orfailure. TheMatcherContinuation attempts to match the remaining portion (specified by the closure's captured values) of the pattern againstInput, starting at the intermediate state given by itsMatchState argument. If the match succeeds, theMatcherContinuation returns the finalMatchState that it reached; if the match fails, theMatcherContinuation returnsfailure.
  • AMatcher is anAbstract Closure that takes two arguments—aMatchState and aMatcherContinuation—and returns either aMatchState orfailure. AMatcher attempts to match a middle subpattern (specified by the closure's captured values) of the pattern against theMatchState's[[Input]], starting at the intermediate state given by itsMatchState argument. TheMatcherContinuation argument should be a closure that matches the rest of the pattern. After matching the subpattern of a pattern to obtain a newMatchState, theMatcher then callsMatcherContinuation on that newMatchState to test if the rest of the pattern can match as well. If it can, theMatcher returns theMatchState returned byMatcherContinuation; if not, theMatcher may try different choices at its choice points, repeatedly callingMatcherContinuation until it either succeeds or all possibilities have been exhausted.

22.2.2.1.1 RegExp Records

ARegExp Record is aRecord value used to store information about a RegExp that is needed during compilation and possibly during matching.

It has the following fields:

Table 66:RegExp Record Fields
Field NameValueMeaning
[[IgnoreCase]]a Booleanindicates whether"i" appears in the RegExp's flags
[[Multiline]]a Booleanindicates whether"m" appears in the RegExp's flags
[[DotAll]]a Booleanindicates whether"s" appears in the RegExp's flags
[[Unicode]]a Booleanindicates whether"u" appears in the RegExp's flags
[[UnicodeSets]]a Booleanindicates whether"v" appears in the RegExp's flags
[[CapturingGroupsCount]]a non-negativeintegerthe number ofleft-capturing parentheses in the RegExp's pattern

22.2.2.2 Runtime Semantics: CompilePattern

Thesyntax-directed operation CompilePattern takes argumentrer (aRegExp Record) and returns anAbstract Closure that takes aList of characters and a non-negativeinteger and returns either aMatchState orfailure. It is defined piecewise over the following productions:

Pattern::Disjunction
  1. Letm beCompileSubpattern ofDisjunction with argumentsrer andforward.
  2. Return a newAbstract Closure with parameters (Input,index) that capturesrer andm and performs the following steps when called:
    1. Assert:Input is aList of characters.
    2. Assert: 0 ≤index ≤ the number of elements inInput.
    3. Letc be a newMatcherContinuation with parameters (y) that captures nothing and performs the following steps when called:
      1. Assert:y is aMatchState.
      2. Returny.
    4. Letcap be aList ofrer.[[CapturingGroupsCount]]undefined values, indexed 1 throughrer.[[CapturingGroupsCount]].
    5. Letx be theMatchState {[[Input]]:Input,[[EndIndex]]:index,[[Captures]]:cap }.
    6. Returnm(x,c).
Note

A Pattern compiles to anAbstract Closure value.RegExpBuiltinExec can then apply this procedure to aList of characters and an offset within thatList to determine whether the pattern would match starting at exactly that offset within theList, and, if it does match, what the values of the capturing parentheses would be. The algorithms in22.2.2 are designed so that compiling a pattern may throw aSyntaxError exception; on the other hand, once the pattern is successfully compiled, applying the resultingAbstract Closure to find a match in aList of characters cannot throw an exception (except for anyimplementation-defined exceptions that can occur anywhere such as out-of-memory).

22.2.2.3 Runtime Semantics: CompileSubpattern

Thesyntax-directed operation CompileSubpattern takes argumentsrer (aRegExp Record) anddirection (forward orbackward) and returns aMatcher.

Note 1

This section is amended inB.1.2.5.

It is defined piecewise over the following productions:

Disjunction::Alternative|Disjunction
  1. Letm1 beCompileSubpattern ofAlternative with argumentsrer anddirection.
  2. Letm2 beCompileSubpattern ofDisjunction with argumentsrer anddirection.
  3. ReturnMatchTwoAlternatives(m1,m2).
Note 2

The| regular expression operator separates two alternatives. The pattern first tries to match the leftAlternative (followed by the sequel of the regular expression); if it fails, it tries to match the rightDisjunction (followed by the sequel of the regular expression). If the leftAlternative, the rightDisjunction, and the sequel all have choice points, all choices in the sequel are tried before moving on to the next choice in the leftAlternative. If choices in the leftAlternative are exhausted, the rightDisjunction is tried instead of the leftAlternative. Any capturing parentheses inside a portion of the pattern skipped by| produceundefined values instead of Strings. Thus, for example,

/a|ab/.exec("abc")

returns the result"a" and not"ab". Moreover,

/((a)|(ab))((c)|(bc))/.exec("abc")

returns the array

["abc","a","a",undefined,"bc",undefined,"bc"]

and not

["abc","ab",undefined,"ab","c","c",undefined]

The order in which the two alternatives are tried is independent of the value ofdirection.

Alternative::[empty]
  1. ReturnEmptyMatcher().
Alternative::AlternativeTerm
  1. Letm1 beCompileSubpattern ofAlternative with argumentsrer anddirection.
  2. Letm2 beCompileSubpattern ofTerm with argumentsrer anddirection.
  3. ReturnMatchSequence(m1,m2,direction).
Note 3

ConsecutiveTerms try to simultaneously match consecutive portions ofInput. Whendirection isforward, if the leftAlternative, the rightTerm, and the sequel of the regular expression all have choice points, all choices in the sequel are tried before moving on to the next choice in the rightTerm, and all choices in the rightTerm are tried before moving on to the next choice in the leftAlternative. Whendirection isbackward, the evaluation order ofAlternative andTerm are reversed.

Term::Assertion
  1. ReturnCompileAssertion ofAssertion with argumentrer.
Note 4

The resultingMatcher is independent ofdirection.

Term::Atom
  1. ReturnCompileAtom ofAtom with argumentsrer anddirection.
Term::AtomQuantifier
  1. Letm beCompileAtom ofAtom with argumentsrer anddirection.
  2. Letq beCompileQuantifier ofQuantifier.
  3. Assert:q.[[Min]]q.[[Max]].
  4. LetparenIndex beCountLeftCapturingParensBefore(Term).
  5. LetparenCount beCountLeftCapturingParensWithin(Atom).
  6. Return a newMatcher with parameters (x,c) that capturesm,q,parenIndex, andparenCount and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. ReturnRepeatMatcher(m,q.[[Min]],q.[[Max]],q.[[Greedy]],x,c,parenIndex,parenCount).

22.2.2.3.1 RepeatMatcher (m,min,max,greedy,x,c,parenIndex,parenCount )

The abstract operation RepeatMatcher takes argumentsm (aMatcher),min (a non-negativeinteger),max (a non-negativeinteger or +∞),greedy (a Boolean),x (aMatchState),c (aMatcherContinuation),parenIndex (a non-negativeinteger), andparenCount (a non-negativeinteger) and returns either aMatchState orfailure. It performs the following steps when called:

  1. Ifmax = 0, returnc(x).
  2. Letd be a newMatcherContinuation with parameters (y) that capturesm,min,max,greedy,x,c,parenIndex, andparenCount and performs the following steps when called:
    1. Assert:y is aMatchState.
    2. Ifmin = 0 andy.[[EndIndex]] =x.[[EndIndex]], returnfailure.
    3. Ifmin = 0, letmin2 be 0; otherwise letmin2 bemin - 1.
    4. Ifmax = +∞, letmax2 be +∞; otherwise letmax2 bemax - 1.
    5. ReturnRepeatMatcher(m,min2,max2,greedy,y,c,parenIndex,parenCount).
  3. Letcap be a copy ofx.[[Captures]].
  4. For eachintegerk in theinclusive interval fromparenIndex + 1 toparenIndex +parenCount, setcap[k] toundefined.
  5. LetInput bex.[[Input]].
  6. Lete bex.[[EndIndex]].
  7. Letxr be theMatchState {[[Input]]:Input,[[EndIndex]]:e,[[Captures]]:cap }.
  8. Ifmin ≠ 0, returnm(xr,d).
  9. Ifgreedy isfalse, then
    1. Letz bec(x).
    2. Ifz is notfailure, returnz.
    3. Returnm(xr,d).
  10. Letz bem(xr,d).
  11. Ifz is notfailure, returnz.
  12. Returnc(x).
Note 1

AnAtom followed by aQuantifier is repeated the number of times specified by theQuantifier. AQuantifier can be non-greedy, in which case theAtom pattern is repeated as few times as possible while still matching the sequel, or it can be greedy, in which case theAtom pattern is repeated as many times as possible while still matching the sequel. TheAtom pattern is repeated rather than the input character sequence that it matches, so different repetitions of theAtom can match different input substrings.

Note 2

If theAtom and the sequel of the regular expression all have choice points, theAtom is first matched as many (or as few, if non-greedy) times as possible. All choices in the sequel are tried before moving on to the next choice in the last repetition ofAtom. All choices in the last (nth) repetition ofAtom are tried before moving on to the next choice in the next-to-last (n - 1)st repetition ofAtom; at which point it may turn out that more or fewer repetitions ofAtom are now possible; these are exhausted (again, starting with either as few or as many as possible) before moving on to the next choice in the (n - 1)st repetition ofAtom and so on.

Compare

/a[a-z]{2,4}/.exec("abcdefghi")

which returns"abcde" with

/a[a-z]{2,4}?/.exec("abcdefghi")

which returns"abc".

Consider also

/(aa|aabaac|ba|b|c)*/.exec("aabaac")

which, by the choice point ordering above, returns the array

["aaba","ba"]

and not any of:

["aabaac","aabaac"]["aabaac","c"]

The above ordering of choice points can be used to write a regular expression that calculates the greatest common divisor of two numbers (represented in unary notation). The following example calculates the gcd of 10 and 15:

"aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(/^(a+)\1*,\1+$/,"$1")

which returns the gcd in unary notation"aaaaa".

Note 3

Step4 of the RepeatMatcher clearsAtom's captures each timeAtom is repeated. We can see its behaviour in the regular expression

/(z)((a+)?(b+)?(c))*/.exec("zaacbbbcac")

which returns the array

["zaacbbbcac","z","ac","a",undefined,"c"]

and not

["zaacbbbcac","z","ac","a","bbb","c"]

because each iteration of the outermost* clears all captured Strings contained in the quantifiedAtom, which in this case includes capture Strings numbered 2, 3, 4, and 5.

Note 4

Step2.b of the RepeatMatcher states that once the minimum number of repetitions has been satisfied, any more expansions ofAtom that match the empty character sequence are not considered for further repetitions. This prevents the regular expression engine from falling into an infinite loop on patterns such as:

/(a*)*/.exec("b")

or the slightly more complicated:

/(a*)b\1+/.exec("baaaac")

which returns the array

["b",""]

22.2.2.3.2 EmptyMatcher ( )

The abstract operation EmptyMatcher takes no arguments and returns aMatcher. It performs the following steps when called:

  1. Return a newMatcher with parameters (x,c) that captures nothing and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Returnc(x).

22.2.2.3.3 MatchTwoAlternatives (m1,m2 )

The abstract operation MatchTwoAlternatives takes argumentsm1 (aMatcher) andm2 (aMatcher) and returns aMatcher. It performs the following steps when called:

  1. Return a newMatcher with parameters (x,c) that capturesm1 andm2 and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Letr bem1(x,c).
    4. Ifr is notfailure, returnr.
    5. Returnm2(x,c).

22.2.2.3.4 MatchSequence (m1,m2,direction )

The abstract operation MatchSequence takes argumentsm1 (aMatcher),m2 (aMatcher), anddirection (forward orbackward) and returns aMatcher. It performs the following steps when called:

  1. Ifdirection isforward, then
    1. Return a newMatcher with parameters (x,c) that capturesm1 andm2 and performs the following steps when called:
      1. Assert:x is aMatchState.
      2. Assert:c is aMatcherContinuation.
      3. Letd be a newMatcherContinuation with parameters (y) that capturesc andm2 and performs the following steps when called:
        1. Assert:y is aMatchState.
        2. Returnm2(y,c).
      4. Returnm1(x,d).
  2. Else,
    1. Assert:direction isbackward.
    2. Return a newMatcher with parameters (x,c) that capturesm1 andm2 and performs the following steps when called:
      1. Assert:x is aMatchState.
      2. Assert:c is aMatcherContinuation.
      3. Letd be a newMatcherContinuation with parameters (y) that capturesc andm1 and performs the following steps when called:
        1. Assert:y is aMatchState.
        2. Returnm1(y,c).
      4. Returnm2(x,d).

22.2.2.4 Runtime Semantics: CompileAssertion

Thesyntax-directed operation CompileAssertion takes argumentrer (aRegExp Record) and returns aMatcher.

Note 1

This section is amended inB.1.2.6.

It is defined piecewise over the following productions:

Assertion::^
  1. Return a newMatcher with parameters (x,c) that capturesrer and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. LetInput bex.[[Input]].
    4. Lete bex.[[EndIndex]].
    5. Ife = 0, or ifrer.[[Multiline]] istrue and the characterInput[e - 1] is matched byLineTerminator, then
      1. Returnc(x).
    6. Returnfailure.
Note 2

Even when they flag is used with a pattern,^ always matches only at the beginning ofInput, or (ifrer.[[Multiline]] istrue) at the beginning of a line.

Assertion::$
  1. Return a newMatcher with parameters (x,c) that capturesrer and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. LetInput bex.[[Input]].
    4. Lete bex.[[EndIndex]].
    5. LetInputLength be the number of elements inInput.
    6. Ife =InputLength, or ifrer.[[Multiline]] istrue and the characterInput[e] is matched byLineTerminator, then
      1. Returnc(x).
    7. Returnfailure.
Assertion::\b
  1. Return a newMatcher with parameters (x,c) that capturesrer and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. LetInput bex.[[Input]].
    4. Lete bex.[[EndIndex]].
    5. Leta beIsWordChar(rer,Input,e - 1).
    6. Letb beIsWordChar(rer,Input,e).
    7. Ifa istrue andb isfalse, or ifa isfalse andb istrue, returnc(x).
    8. Returnfailure.
Assertion::\B
  1. Return a newMatcher with parameters (x,c) that capturesrer and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. LetInput bex.[[Input]].
    4. Lete bex.[[EndIndex]].
    5. Leta beIsWordChar(rer,Input,e - 1).
    6. Letb beIsWordChar(rer,Input,e).
    7. Ifa istrue andb istrue, or ifa isfalse andb isfalse, returnc(x).
    8. Returnfailure.
Assertion::(?=Disjunction)
  1. Letm beCompileSubpattern ofDisjunction with argumentsrer andforward.
  2. Return a newMatcher with parameters (x,c) that capturesm and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Letd be a newMatcherContinuation with parameters (y) that captures nothing and performs the following steps when called:
      1. Assert:y is aMatchState.
      2. Returny.
    4. Letr bem(x,d).
    5. Ifr isfailure, returnfailure.
    6. Assert:r is aMatchState.
    7. Letcap ber.[[Captures]].
    8. LetInput bex.[[Input]].
    9. Letxe bex.[[EndIndex]].
    10. Letz be theMatchState {[[Input]]:Input,[[EndIndex]]:xe,[[Captures]]:cap }.
    11. Returnc(z).
Note 3

The form(?=Disjunction) specifies a zero-width positive lookahead. In order for it to succeed, the pattern insideDisjunction must match at the current position, but the current position is not advanced before matching the sequel. IfDisjunction can match at the current position in several ways, only the first one is tried. Unlike other regular expression operators, there is no backtracking into a(?= form (this unusual behaviour is inherited from Perl). This only matters when theDisjunction contains capturing parentheses and the sequel of the pattern contains backreferences to those captures.

For example,

/(?=(a+))/.exec("baaabac")

matches the empty String immediately after the firstb and therefore returns the array:

["","aaa"]

To illustrate the lack of backtracking into the lookahead, consider:

/(?=(a+))a*b\1/.exec("baaabac")

This expression returns

["aba","a"]

and not:

["aaaba","a"]
Assertion::(?!Disjunction)
  1. Letm beCompileSubpattern ofDisjunction with argumentsrer andforward.
  2. Return a newMatcher with parameters (x,c) that capturesm and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Letd be a newMatcherContinuation with parameters (y) that captures nothing and performs the following steps when called:
      1. Assert:y is aMatchState.
      2. Returny.
    4. Letr bem(x,d).
    5. Ifr is notfailure, returnfailure.
    6. Returnc(x).
Note 4

The form(?!Disjunction) specifies a zero-width negative lookahead. In order for it to succeed, the pattern insideDisjunction must fail to match at the current position. The current position is not advanced before matching the sequel.Disjunction can contain capturing parentheses, but backreferences to them only make sense from withinDisjunction itself. Backreferences to these capturing parentheses from elsewhere in the pattern always returnundefined because the negative lookahead must fail for the pattern to succeed. For example,

/(.*?)a(?!(a+)b\2c)\2(.*)/.exec("baaabaac")

looks for ana not immediately followed by some positive number n ofa's, ab, another na's (specified by the first\2) and ac. The second\2 is outside the negative lookahead, so it matches againstundefined and therefore always succeeds. The whole expression returns the array:

["baaabaac","ba",undefined,"abaac"]
Assertion::(?<=Disjunction)
  1. Letm beCompileSubpattern ofDisjunction with argumentsrer andbackward.
  2. Return a newMatcher with parameters (x,c) that capturesm and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Letd be a newMatcherContinuation with parameters (y) that captures nothing and performs the following steps when called:
      1. Assert:y is aMatchState.
      2. Returny.
    4. Letr bem(x,d).
    5. Ifr isfailure, returnfailure.
    6. Assert:r is aMatchState.
    7. Letcap ber.[[Captures]].
    8. LetInput bex.[[Input]].
    9. Letxe bex.[[EndIndex]].
    10. Letz be theMatchState {[[Input]]:Input,[[EndIndex]]:xe,[[Captures]]:cap }.
    11. Returnc(z).
Assertion::(?<!Disjunction)
  1. Letm beCompileSubpattern ofDisjunction with argumentsrer andbackward.
  2. Return a newMatcher with parameters (x,c) that capturesm and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Letd be a newMatcherContinuation with parameters (y) that captures nothing and performs the following steps when called:
      1. Assert:y is aMatchState.
      2. Returny.
    4. Letr bem(x,d).
    5. Ifr is notfailure, returnfailure.
    6. Returnc(x).

22.2.2.4.1 IsWordChar (rer,Input,e )

The abstract operation IsWordChar takes argumentsrer (aRegExp Record),Input (aList of characters), ande (aninteger) and returns a Boolean. It performs the following steps when called:

  1. LetInputLength be the number of elements inInput.
  2. Ife = -1 ore =InputLength, returnfalse.
  3. Letc be the characterInput[e].
  4. IfWordCharacters(rer) containsc, returntrue.
  5. Returnfalse.

22.2.2.5 Runtime Semantics: CompileQuantifier

Thesyntax-directed operation CompileQuantifier takes no arguments and returns aRecord with fields[[Min]] (a non-negativeinteger),[[Max]] (a non-negativeinteger or +∞), and[[Greedy]] (a Boolean). It is defined piecewise over the following productions:

Quantifier::QuantifierPrefix
  1. Letqp beCompileQuantifierPrefix ofQuantifierPrefix.
  2. Return theRecord {[[Min]]:qp.[[Min]],[[Max]]:qp.[[Max]],[[Greedy]]:true }.
Quantifier::QuantifierPrefix?
  1. Letqp beCompileQuantifierPrefix ofQuantifierPrefix.
  2. Return theRecord {[[Min]]:qp.[[Min]],[[Max]]:qp.[[Max]],[[Greedy]]:false }.

22.2.2.6 Runtime Semantics: CompileQuantifierPrefix

Thesyntax-directed operation CompileQuantifierPrefix takes no arguments and returns aRecord with fields[[Min]] (a non-negativeinteger) and[[Max]] (a non-negativeinteger or +∞). It is defined piecewise over the following productions:

QuantifierPrefix::*
  1. Return theRecord {[[Min]]: 0,[[Max]]: +∞ }.
QuantifierPrefix::+
  1. Return theRecord {[[Min]]: 1,[[Max]]: +∞ }.
QuantifierPrefix::?
  1. Return theRecord {[[Min]]: 0,[[Max]]: 1 }.
QuantifierPrefix::{DecimalDigits}
  1. Leti be the MV ofDecimalDigits (see12.9.3).
  2. Return theRecord {[[Min]]:i,[[Max]]:i }.
QuantifierPrefix::{DecimalDigits,}
  1. Leti be the MV ofDecimalDigits.
  2. Return theRecord {[[Min]]:i,[[Max]]: +∞ }.
QuantifierPrefix::{DecimalDigits,DecimalDigits}
  1. Leti be the MV of the firstDecimalDigits.
  2. Letj be the MV of the secondDecimalDigits.
  3. Return theRecord {[[Min]]:i,[[Max]]:j }.

22.2.2.7 Runtime Semantics: CompileAtom

Thesyntax-directed operation CompileAtom takes argumentsrer (aRegExp Record) anddirection (forward orbackward) and returns aMatcher.

Note 1

This section is amended inB.1.2.7.

It is defined piecewise over the following productions:

Atom::PatternCharacter
  1. Letch be the character matched byPatternCharacter.
  2. LetA be a one-elementCharSet containing the characterch.
  3. ReturnCharacterSetMatcher(rer,A,false,direction).
Atom::.
  1. LetA beAllCharacters(rer).
  2. Ifrer.[[DotAll]] is nottrue, then
    1. Remove fromA all characters corresponding to a code point on the right-hand side of theLineTerminator production.
  3. ReturnCharacterSetMatcher(rer,A,false,direction).
Atom::CharacterClass
  1. Letcc beCompileCharacterClass ofCharacterClass with argumentrer.
  2. Letcs becc.[[CharSet]].
  3. Ifrer.[[UnicodeSets]] isfalse, or if everyCharSetElement ofcs consists of a single character (including ifcs is empty), returnCharacterSetMatcher(rer,cs,cc.[[Invert]],direction).
  4. Assert:cc.[[Invert]] isfalse.
  5. Letlm be an emptyList ofMatchers.
  6. For eachCharSetElements incs containing more than 1 character, iterating in descending order of length, do
    1. Letcs2 be a one-elementCharSet containing the last code point ofs.
    2. Letm2 beCharacterSetMatcher(rer,cs2,false,direction).
    3. For each code pointc1 ins, iterating backwards from its second-to-last code point, do
      1. Letcs1 be a one-elementCharSet containingc1.
      2. Letm1 beCharacterSetMatcher(rer,cs1,false,direction).
      3. Setm2 toMatchSequence(m1,m2,direction).
    4. Appendm2 tolm.
  7. Letsingles be theCharSet containing everyCharSetElement ofcs that consists of a single character.
  8. AppendCharacterSetMatcher(rer,singles,false,direction) tolm.
  9. Ifcs contains the empty sequence of characters, appendEmptyMatcher() tolm.
  10. Letm2 be the lastMatcher inlm.
  11. For eachMatcherm1 oflm, iterating backwards from its second-to-last element, do
    1. Setm2 toMatchTwoAlternatives(m1,m2).
  12. Returnm2.
Atom::(GroupSpecifieroptDisjunction)
  1. Letm beCompileSubpattern ofDisjunction with argumentsrer anddirection.
  2. LetparenIndex beCountLeftCapturingParensBefore(Atom).
  3. Return a newMatcher with parameters (x,c) that capturesdirection,m, andparenIndex and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. Letd be a newMatcherContinuation with parameters (y) that capturesx,c,direction, andparenIndex and performs the following steps when called:
      1. Assert:y is aMatchState.
      2. Letcap be a copy ofy.[[Captures]].
      3. LetInput bex.[[Input]].
      4. Letxe bex.[[EndIndex]].
      5. Letye bey.[[EndIndex]].
      6. Ifdirection isforward, then
        1. Assert:xeye.
        2. Letr be theCaptureRange {[[StartIndex]]:xe,[[EndIndex]]:ye }.
      7. Else,
        1. Assert:direction isbackward.
        2. Assert:yexe.
        3. Letr be theCaptureRange {[[StartIndex]]:ye,[[EndIndex]]:xe }.
      8. Setcap[parenIndex + 1] tor.
      9. Letz be theMatchState {[[Input]]:Input,[[EndIndex]]:ye,[[Captures]]:cap }.
      10. Returnc(z).
    4. Returnm(x,d).
Note 2

Parentheses of the form(Disjunction) serve both to group the components of theDisjunction pattern together and to save the result of the match. The result can be used either in a backreference (\ followed by a non-zero decimal number), referenced in a replace String, or returned as part of an array from the regular expression matchingAbstract Closure. To inhibit the capturing behaviour of parentheses, use the form(?:Disjunction) instead.

Atom::(?RegularExpressionModifiers:Disjunction)
  1. LetaddModifiers be thesource text matched byRegularExpressionModifiers.
  2. LetremoveModifiers be the empty String.
  3. LetmodifiedRer beUpdateModifiers(rer,CodePointsToString(addModifiers),removeModifiers).
  4. ReturnCompileSubpattern ofDisjunction with argumentsmodifiedRer anddirection.
Atom::(?RegularExpressionModifiers-RegularExpressionModifiers:Disjunction)
  1. LetaddModifiers be thesource text matched by the firstRegularExpressionModifiers.
  2. LetremoveModifiers be thesource text matched by the secondRegularExpressionModifiers.
  3. LetmodifiedRer beUpdateModifiers(rer,CodePointsToString(addModifiers),CodePointsToString(removeModifiers)).
  4. ReturnCompileSubpattern ofDisjunction with argumentsmodifiedRer anddirection.
AtomEscape::DecimalEscape
  1. Letn be theCapturingGroupNumber ofDecimalEscape.
  2. Assert:nrer.[[CapturingGroupsCount]].
  3. ReturnBackreferenceMatcher(rer, «n »,direction).
Note 3

An escape sequence of the form\ followed by a non-zero decimal numbern matches the result of thenth set of capturing parentheses (22.2.2.1). It is an error if the regular expression has fewer thann capturing parentheses. If the regular expression hasn or more capturing parentheses but thenth one isundefined because it has not captured anything, then the backreference always succeeds.

AtomEscape::CharacterEscape
  1. Letcv be theCharacterValue ofCharacterEscape.
  2. Letch be the character whose character value iscv.
  3. LetA be a one-elementCharSet containing the characterch.
  4. ReturnCharacterSetMatcher(rer,A,false,direction).
AtomEscape::CharacterClassEscape
  1. Letcs beCompileToCharSet ofCharacterClassEscape with argumentrer.
  2. Ifrer.[[UnicodeSets]] isfalse, or if everyCharSetElement ofcs consists of a single character (including ifcs is empty), returnCharacterSetMatcher(rer,cs,false,direction).
  3. Letlm be an emptyList ofMatchers.
  4. For eachCharSetElements incs containing more than 1 character, iterating in descending order of length, do
    1. Letcs2 be a one-elementCharSet containing the last code point ofs.
    2. Letm2 beCharacterSetMatcher(rer,cs2,false,direction).
    3. For each code pointc1 ins, iterating backwards from its second-to-last code point, do
      1. Letcs1 be a one-elementCharSet containingc1.
      2. Letm1 beCharacterSetMatcher(rer,cs1,false,direction).
      3. Setm2 toMatchSequence(m1,m2,direction).
    4. Appendm2 tolm.
  5. Letsingles be theCharSet containing everyCharSetElement ofcs that consists of a single character.
  6. AppendCharacterSetMatcher(rer,singles,false,direction) tolm.
  7. Ifcs contains the empty sequence of characters, appendEmptyMatcher() tolm.
  8. Letm2 be the lastMatcher inlm.
  9. For eachMatcherm1 oflm, iterating backwards from its second-to-last element, do
    1. Setm2 toMatchTwoAlternatives(m1,m2).
  10. Returnm2.
AtomEscape::kGroupName
  1. LetmatchingGroupSpecifiers beGroupSpecifiersThatMatch(GroupName).
  2. LetparenIndices be a new emptyList.
  3. For eachGroupSpecifiergroupSpecifier ofmatchingGroupSpecifiers, do
    1. LetparenIndex beCountLeftCapturingParensBefore(groupSpecifier).
    2. AppendparenIndex toparenIndices.
  4. ReturnBackreferenceMatcher(rer,parenIndices,direction).

22.2.2.7.1 CharacterSetMatcher (rer,A,invert,direction )

The abstract operation CharacterSetMatcher takes argumentsrer (aRegExp Record),A (aCharSet),invert (a Boolean), anddirection (forward orbackward) and returns aMatcher. It performs the following steps when called:

  1. Ifrer.[[UnicodeSets]] istrue, then
    1. Assert:invert isfalse.
    2. Assert: EveryCharSetElement ofA consists of a single character.
  2. Return a newMatcher with parameters (x,c) that capturesrer,A,invert, anddirection and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. LetInput bex.[[Input]].
    4. Lete bex.[[EndIndex]].
    5. Ifdirection isforward, letf bee + 1.
    6. Else, letf bee - 1.
    7. LetInputLength be the number of elements inInput.
    8. Iff < 0 orf >InputLength, returnfailure.
    9. Letindex bemin(e,f).
    10. Letch be the characterInput[index].
    11. Letcc beCanonicalize(rer,ch).
    12. If there exists aCharSetElement inA containing exactly one charactera such thatCanonicalize(rer,a) iscc, letfound betrue; otherwise letfound befalse.
    13. Ifinvert isfalse andfound isfalse, returnfailure.
    14. Ifinvert istrue andfound istrue, returnfailure.
    15. Letcap bex.[[Captures]].
    16. Lety be theMatchState {[[Input]]:Input,[[EndIndex]]:f,[[Captures]]:cap }.
    17. Returnc(y).

22.2.2.7.2 BackreferenceMatcher (rer,ns,direction )

The abstract operation BackreferenceMatcher takes argumentsrer (aRegExp Record),ns (aList of positiveintegers), anddirection (forward orbackward) and returns aMatcher. It performs the following steps when called:

  1. Return a newMatcher with parameters (x,c) that capturesrer,ns, anddirection and performs the following steps when called:
    1. Assert:x is aMatchState.
    2. Assert:c is aMatcherContinuation.
    3. LetInput bex.[[Input]].
    4. Letcap bex.[[Captures]].
    5. Letr beundefined.
    6. For eachintegern ofns, do
      1. Ifcap[n] is notundefined, then
        1. Assert:r isundefined.
        2. Setr tocap[n].
    7. Ifr isundefined, returnc(x).
    8. Lete bex.[[EndIndex]].
    9. Letrs ber.[[StartIndex]].
    10. Letre ber.[[EndIndex]].
    11. Letlen bere -rs.
    12. Ifdirection isforward, letf bee +len.
    13. Else, letf bee -len.
    14. LetInputLength be the number of elements inInput.
    15. Iff < 0 orf >InputLength, returnfailure.
    16. Letg bemin(e,f).
    17. If there exists anintegeri in theinterval from 0 (inclusive) tolen (exclusive) such thatCanonicalize(rer,Input[rs +i]) is notCanonicalize(rer,Input[g +i]), returnfailure.
    18. Lety be theMatchState {[[Input]]:Input,[[EndIndex]]:f,[[Captures]]:cap }.
    19. Returnc(y).

22.2.2.7.3 Canonicalize (rer,ch )

The abstract operation Canonicalize takes argumentsrer (aRegExp Record) andch (a character) and returns a character. It performs the following steps when called:

  1. IfHasEitherUnicodeFlag(rer) istrue andrer.[[IgnoreCase]] istrue, then
    1. If the fileCaseFolding.txt of the Unicode Character Database provides a simple or common case folding mapping forch, return the result of applying that mapping toch.
    2. Returnch.
  2. Ifrer.[[IgnoreCase]] isfalse, returnch.
  3. Assert:ch is a UTF-16 code unit.
  4. Letcp be the code point whose numeric value is the numeric value ofch.
  5. Letu be toUppercase(«cp »), according to the Unicode Default Case Conversion algorithm.
  6. LetuStr beCodePointsToString(u).
  7. If the length ofuStr ≠ 1, returnch.
  8. Letcu beuStr's single code unit element.
  9. If the numeric value ofch ≥ 128 and the numeric value ofcu < 128, returnch.
  10. Returncu.
Note

In case-insignificant matches whenHasEitherUnicodeFlag(rer) istrue, all characters are implicitly case-folded using the simple mapping provided by the Unicode Standard immediately before they are compared. The simple mapping always maps to a single code point, so it does not map, for example,ß (U+00DF LATIN SMALL LETTER SHARP S) toss orSS. It may however map code points outside the Basic Latin block to code points within it—for example,ſ (U+017F LATIN SMALL LETTER LONG S) case-folds tos (U+0073 LATIN SMALL LETTER S) and (U+212A KELVIN SIGN) case-folds tok (U+006B LATIN SMALL LETTER K). Strings containing those code points are matched by regular expressions such as/[a-z]/ui.

In case-insignificant matches whenHasEitherUnicodeFlag(rer) isfalse, the mapping is based on Unicode Default Case Conversion algorithm toUppercase rather than toCasefold, which results in some subtle differences. For example, (U+2126 OHM SIGN) is mapped by toUppercase to itself but by toCasefold toω (U+03C9 GREEK SMALL LETTER OMEGA) along withΩ (U+03A9 GREEK CAPITAL LETTER OMEGA), so"\u2126" is matched by/[ω]/ui and/[\u03A9]/ui but not by/[ω]/i or/[\u03A9]/i. Also, no code point outside the Basic Latin block is mapped to a code point within it, so strings such as"\u017F ſ" and"\u212A K" are not matched by/[a-z]/i.

22.2.2.7.4 UpdateModifiers (rer,add,remove )

The abstract operation UpdateModifiers takes argumentsrer (aRegExp Record),add (a String), andremove (a String) and returns aRegExp Record. It performs the following steps when called:

  1. Assert:add andremove have no elements in common.
  2. LetignoreCase berer.[[IgnoreCase]].
  3. Letmultiline berer.[[Multiline]].
  4. LetdotAll berer.[[DotAll]].
  5. Letunicode berer.[[Unicode]].
  6. LetunicodeSets berer.[[UnicodeSets]].
  7. LetcapturingGroupsCount berer.[[CapturingGroupsCount]].
  8. Ifremove contains"i", setignoreCase tofalse.
  9. Else ifadd contains"i", setignoreCase totrue.
  10. Ifremove contains"m", setmultiline tofalse.
  11. Else ifadd contains"m", setmultiline totrue.
  12. Ifremove contains"s", setdotAll tofalse.
  13. Else ifadd contains"s", setdotAll totrue.
  14. Return theRegExp Record {[[IgnoreCase]]:ignoreCase,[[Multiline]]:multiline,[[DotAll]]:dotAll,[[Unicode]]:unicode,[[UnicodeSets]]:unicodeSets,[[CapturingGroupsCount]]:capturingGroupsCount }.

22.2.2.8 Runtime Semantics: CompileCharacterClass

Thesyntax-directed operation CompileCharacterClass takes argumentrer (aRegExp Record) and returns aRecord with fields[[CharSet]] (aCharSet) and[[Invert]] (a Boolean). It is defined piecewise over the following productions:

CharacterClass::[ClassContents]
  1. LetA beCompileToCharSet ofClassContents with argumentrer.
  2. Return theRecord {[[CharSet]]:A,[[Invert]]:false }.
CharacterClass::[^ClassContents]
  1. LetA beCompileToCharSet ofClassContents with argumentrer.
  2. Ifrer.[[UnicodeSets]] istrue, then
    1. Return theRecord {[[CharSet]]:CharacterComplement(rer,A),[[Invert]]:false }.
  3. Return theRecord {[[CharSet]]:A,[[Invert]]:true }.

22.2.2.9 Runtime Semantics: CompileToCharSet

Thesyntax-directed operation CompileToCharSet takes argumentrer (aRegExp Record) and returns aCharSet.

Note 1

This section is amended inB.1.2.8.

It is defined piecewise over the following productions:

ClassContents::[empty]
  1. Return the emptyCharSet.
NonemptyClassRanges::ClassAtomNonemptyClassRangesNoDash
  1. LetA beCompileToCharSet ofClassAtom with argumentrer.
  2. LetB beCompileToCharSet ofNonemptyClassRangesNoDash with argumentrer.
  3. Return the union ofCharSetsA andB.
NonemptyClassRanges::ClassAtom-ClassAtomClassContents
  1. LetA beCompileToCharSet of the firstClassAtom with argumentrer.
  2. LetB beCompileToCharSet of the secondClassAtom with argumentrer.
  3. LetC beCompileToCharSet ofClassContents with argumentrer.
  4. LetD beCharacterRange(A,B).
  5. Return the union ofD andC.
NonemptyClassRangesNoDash::ClassAtomNoDashNonemptyClassRangesNoDash
  1. LetA beCompileToCharSet ofClassAtomNoDash with argumentrer.
  2. LetB beCompileToCharSet ofNonemptyClassRangesNoDash with argumentrer.
  3. Return the union ofCharSetsA andB.
NonemptyClassRangesNoDash::ClassAtomNoDash-ClassAtomClassContents
  1. LetA beCompileToCharSet ofClassAtomNoDash with argumentrer.
  2. LetB beCompileToCharSet ofClassAtom with argumentrer.
  3. LetC beCompileToCharSet ofClassContents with argumentrer.
  4. LetD beCharacterRange(A,B).
  5. Return the union ofD andC.
Note 2

ClassContents can expand into a singleClassAtom and/or ranges of twoClassAtom separated by dashes. In the latter case theClassContents includes all characters between the firstClassAtom and the secondClassAtom, inclusive; an error occurs if eitherClassAtom does not represent a single character (for example, if one is \w) or if the firstClassAtom's character value is strictly greater than the secondClassAtom's character value.

Note 3

Even if the pattern ignores case, the case of the two ends of a range is significant in determining which characters belong to the range. Thus, for example, the pattern/[E-F]/i matches only the lettersE,F,e, andf, while the pattern/[E-f]/i matches all uppercase and lowercase letters in the Unicode Basic Latin block as well as the symbols[,\,],^,_, and`.

Note 4

A- character can be treated literally or it can denote a range. It is treated literally if it is the first or last character ofClassContents, the beginning or end limit of a range specification, or immediately follows a range specification.

ClassAtom::-
  1. Return theCharSet containing the single character- U+002D (HYPHEN-MINUS).
ClassAtomNoDash::SourceCharacterbut not one of\ or] or-
  1. Return theCharSet containing the character matched bySourceCharacter.
ClassEscape::b-CharacterEscape
  1. Letcv be theCharacterValue of thisClassEscape.
  2. Letc be the character whose character value iscv.
  3. Return theCharSet containing the single characterc.
Note 5

AClassAtom can use any of the escape sequences that are allowed in the rest of the regular expression except for\b,\B, and backreferences. Inside aCharacterClass,\b means the backspace character, while\B and backreferences raise errors. Using a backreference inside aClassAtom causes an error.

CharacterClassEscape::d
  1. Return the ten-elementCharSet containing the characters0,1,2,3,4,5,6,7,8, and9.
CharacterClassEscape::D
  1. LetS be theCharSet returned byCharacterClassEscape::d.
  2. ReturnCharacterComplement(rer,S).
CharacterClassEscape::s
  1. Return theCharSet containing all characters corresponding to a code point on the right-hand side of theWhiteSpace orLineTerminator productions.
CharacterClassEscape::S
  1. LetS be theCharSet returned byCharacterClassEscape::s.
  2. ReturnCharacterComplement(rer,S).
CharacterClassEscape::w
  1. ReturnMaybeSimpleCaseFolding(rer,WordCharacters(rer)).
CharacterClassEscape::W
  1. LetS be theCharSet returned byCharacterClassEscape::w.
  2. ReturnCharacterComplement(rer,S).
CharacterClassEscape::p{UnicodePropertyValueExpression}
  1. ReturnCompileToCharSet ofUnicodePropertyValueExpression with argumentrer.
CharacterClassEscape::P{UnicodePropertyValueExpression}
  1. LetS beCompileToCharSet ofUnicodePropertyValueExpression with argumentrer.
  2. Assert:S contains only single code points.
  3. ReturnCharacterComplement(rer,S).
UnicodePropertyValueExpression::UnicodePropertyName=UnicodePropertyValue
  1. Letps be thesource text matched byUnicodePropertyName.
  2. Letp beUnicodeMatchProperty(rer,ps).
  3. Assert:p is aUnicode property name or property alias listed in the “Property name and aliases” column ofTable 67.
  4. Letvs be thesource text matched byUnicodePropertyValue.
  5. Letv beUnicodeMatchPropertyValue(p,vs).
  6. LetA be theCharSet containing all Unicode code points whose character database definition includes the propertyp with valuev.
  7. ReturnMaybeSimpleCaseFolding(rer,A).
UnicodePropertyValueExpression::LoneUnicodePropertyNameOrValue
  1. Lets be thesource text matched byLoneUnicodePropertyNameOrValue.
  2. IfUnicodeMatchPropertyValue(General_Category,s) is a Unicode property value or property value alias for the General_Category (gc) property listed inPropertyValueAliases.txt, then
    1. Return theCharSet containing all Unicode code points whose character database definition includes the property “General_Category” with values.
  3. Letp beUnicodeMatchProperty(rer,s).
  4. Assert:p is a binary Unicode property or binary property alias listed in the “Property name and aliases” column ofTable 68, or a binary Unicode property of strings listed in the “Property name” column ofTable 69.
  5. LetA be theCharSet containing all CharSetElements whose character database definition includes the propertyp with value “True”.
  6. ReturnMaybeSimpleCaseFolding(rer,A).
ClassUnion::ClassSetRangeClassUnionopt
  1. LetA beCompileToCharSet ofClassSetRange with argumentrer.
  2. IfClassUnion is present, then
    1. LetB beCompileToCharSet ofClassUnion with argumentrer.
    2. Return the union ofCharSetsA andB.
  3. ReturnA.
ClassUnion::ClassSetOperandClassUnionopt
  1. LetA beCompileToCharSet ofClassSetOperand with argumentrer.
  2. IfClassUnion is present, then
    1. LetB beCompileToCharSet ofClassUnion with argumentrer.
    2. Return the union ofCharSetsA andB.
  3. ReturnA.
ClassIntersection::ClassSetOperand&&ClassSetOperand
  1. LetA beCompileToCharSet of the firstClassSetOperand with argumentrer.
  2. LetB beCompileToCharSet of the secondClassSetOperand with argumentrer.
  3. Return the intersection ofCharSetsA andB.
ClassIntersection::ClassIntersection&&ClassSetOperand
  1. LetA beCompileToCharSet of theClassIntersection with argumentrer.
  2. LetB beCompileToCharSet of theClassSetOperand with argumentrer.
  3. Return the intersection ofCharSetsA andB.
ClassSubtraction::ClassSetOperand--ClassSetOperand
  1. LetA beCompileToCharSet of the firstClassSetOperand with argumentrer.
  2. LetB beCompileToCharSet of the secondClassSetOperand with argumentrer.
  3. Return theCharSet containing the CharSetElements ofA which are not also CharSetElements ofB.
ClassSubtraction::ClassSubtraction--ClassSetOperand
  1. LetA beCompileToCharSet of theClassSubtraction with argumentrer.
  2. LetB beCompileToCharSet of theClassSetOperand with argumentrer.
  3. Return theCharSet containing the CharSetElements ofA which are not also CharSetElements ofB.
ClassSetRange::ClassSetCharacter-ClassSetCharacter
  1. LetA beCompileToCharSet of the firstClassSetCharacter with argumentrer.
  2. LetB beCompileToCharSet of the secondClassSetCharacter with argumentrer.
  3. ReturnMaybeSimpleCaseFolding(rer,CharacterRange(A,B)).
Note 6

The result will often consist of two or more ranges. When UnicodeSets istrue and IgnoreCase istrue, thenMaybeSimpleCaseFolding(rer, [Ā-č]) will include only the odd-numbered code points of that range.

ClassSetOperand::ClassSetCharacter
  1. LetA beCompileToCharSet ofClassSetCharacter with argumentrer.
  2. ReturnMaybeSimpleCaseFolding(rer,A).
ClassSetOperand::ClassStringDisjunction
  1. LetA beCompileToCharSet ofClassStringDisjunction with argumentrer.
  2. ReturnMaybeSimpleCaseFolding(rer,A).
ClassSetOperand::NestedClass
  1. ReturnCompileToCharSet ofNestedClass with argumentrer.
NestedClass::[ClassContents]
  1. ReturnCompileToCharSet ofClassContents with argumentrer.
NestedClass::[^ClassContents]
  1. LetA beCompileToCharSet ofClassContents with argumentrer.
  2. ReturnCharacterComplement(rer,A).
NestedClass::\CharacterClassEscape
  1. ReturnCompileToCharSet ofCharacterClassEscape with argumentrer.
ClassStringDisjunction::\q{ClassStringDisjunctionContents}
  1. ReturnCompileToCharSet ofClassStringDisjunctionContents with argumentrer.
ClassStringDisjunctionContents::ClassString
  1. Lets beCompileClassSetString ofClassString with argumentrer.
  2. Return theCharSet containing the one strings.
ClassStringDisjunctionContents::ClassString|ClassStringDisjunctionContents
  1. Lets beCompileClassSetString ofClassString with argumentrer.
  2. LetA be theCharSet containing the one strings.
  3. LetB beCompileToCharSet ofClassStringDisjunctionContents with argumentrer.
  4. Return the union ofCharSetsA andB.
ClassSetCharacter::SourceCharacterbut notClassSetSyntaxCharacter\CharacterEscape\ClassSetReservedPunctuator
  1. Letcv be theCharacterValue of thisClassSetCharacter.
  2. Letc be the character whose character value iscv.
  3. Return theCharSet containing the single characterc.
ClassSetCharacter::\b
  1. Return theCharSet containing the single character U+0008 (BACKSPACE).

22.2.2.9.1 CharacterRange (A,B )

The abstract operation CharacterRange takes argumentsA (aCharSet) andB (aCharSet) and returns aCharSet. It performs the following steps when called:

  1. Assert:A andB each contain exactly one character.
  2. Leta be the one character inCharSetA.
  3. Letb be the one character inCharSetB.
  4. Leti be the character value of charactera.
  5. Letj be the character value of characterb.
  6. Assert:ij.
  7. Return theCharSet containing all characters with a character value in theinclusive interval fromi toj.

22.2.2.9.2 HasEitherUnicodeFlag (rer )

The abstract operation HasEitherUnicodeFlag takes argumentrer (aRegExp Record) and returns a Boolean. It performs the following steps when called:

  1. Ifrer.[[Unicode]] istrue orrer.[[UnicodeSets]] istrue, then
    1. Returntrue.
  2. Returnfalse.

22.2.2.9.3 WordCharacters (rer )

The abstract operation WordCharacters takes argumentrer (aRegExp Record) and returns aCharSet. Returns aCharSet containing the characters considered "word characters" for the purposes of\b,\B,\w, and\W It performs the following steps when called:

  1. LetbasicWordChars be theCharSet containing every character inthe ASCII word characters.
  2. LetextraWordChars be theCharSet containing all charactersc such thatc is not inbasicWordChars butCanonicalize(rer,c) is inbasicWordChars.
  3. Assert:extraWordChars is empty unlessHasEitherUnicodeFlag(rer) istrue andrer.[[IgnoreCase]] istrue.
  4. Return the union ofbasicWordChars andextraWordChars.

22.2.2.9.4 AllCharacters (rer )

The abstract operation AllCharacters takes argumentrer (aRegExp Record) and returns aCharSet. Returns the set of “all characters” according to the regular expression flags. It performs the following steps when called:

  1. Ifrer.[[UnicodeSets]] istrue andrer.[[IgnoreCase]] istrue, then
    1. Return theCharSet containing all Unicode code pointsc that do not have aSimple Case Folding mapping (that is,scf(c)=c).
  2. Else ifHasEitherUnicodeFlag(rer) istrue, then
    1. Return theCharSet containing all code point values.
  3. Else,
    1. Return theCharSet containing all code unit values.

22.2.2.9.5 MaybeSimpleCaseFolding (rer,A )

The abstract operation MaybeSimpleCaseFolding takes argumentsrer (aRegExp Record) andA (aCharSet) and returns aCharSet. Ifrer.[[UnicodeSets]] isfalse orrer.[[IgnoreCase]] isfalse, it returnsA. Otherwise, it uses theSimple Case Folding (scf(cp)) definitions in the fileCaseFolding.txt of the Unicode Character Database (each of which maps a single code point to another single code point) to map eachCharSetElement ofA character-by-character into a canonical form and returns the resultingCharSet. It performs the following steps when called:

  1. Ifrer.[[UnicodeSets]] isfalse orrer.[[IgnoreCase]] isfalse, returnA.
  2. LetB be a new emptyCharSet.
  3. For eachCharSetElements ofA, do
    1. Lett be an empty sequence of characters.
    2. For each single code pointcp ins, do
      1. Appendscf(cp) tot.
    3. Addt toB.
  4. ReturnB.

22.2.2.9.6 CharacterComplement (rer,S )

The abstract operation CharacterComplement takes argumentsrer (aRegExp Record) andS (aCharSet) and returns aCharSet. It performs the following steps when called:

  1. LetA beAllCharacters(rer).
  2. Return theCharSet containing the CharSetElements ofA which are not also CharSetElements ofS.

22.2.2.9.7 UnicodeMatchProperty (rer,p )

The abstract operation UnicodeMatchProperty takes argumentsrer (aRegExp Record) andp (ECMAScript source text) and returns aUnicode property name. It performs the following steps when called:

  1. Ifrer.[[UnicodeSets]] istrue andp is aUnicode property name listed in the “Property name” column ofTable 69, then
    1. Return theList of Unicode code pointsp.
  2. Assert:p is aUnicode property name or property alias listed in the “Property name and aliases” column ofTable 67 orTable 68.
  3. Letc be the canonicalproperty name ofp as given in the “Canonical property name” column of the corresponding row.
  4. Return theList of Unicode code pointsc.

Implementations must support theUnicode property names and aliases listed inTable 67,Table 68, andTable 69. To ensure interoperability, implementations must not support any otherproperty names or aliases.

Note 1

For example,Script_Extensions (property name) andscx (property alias) are valid, butscript_extensions orScx aren't.

Note 2

The listed properties form a superset of whatUTS18 RL1.2 requires.

Note 3

The spellings of entries in these tables (including casing) match the spellings used in the filePropertyAliases.txt in the Unicode Character Database. The precise spellings in that file areguaranteed to be stable.

Table 67: Non-binary Unicode property aliases and their canonicalproperty names
Property name and aliasesCanonical property name
General_CategoryGeneral_Category
gc
ScriptScript
sc
Script_ExtensionsScript_Extensions
scx
Table 68: Binary Unicode property aliases and their canonicalproperty names
Property name and aliasesCanonical property name
ASCIIASCII
ASCII_Hex_DigitASCII_Hex_Digit
AHex
AlphabeticAlphabetic
Alpha
AnyAny
AssignedAssigned
Bidi_ControlBidi_Control
Bidi_C
Bidi_MirroredBidi_Mirrored
Bidi_M
Case_IgnorableCase_Ignorable
CI
CasedCased
Changes_When_CasefoldedChanges_When_Casefolded
CWCF
Changes_When_CasemappedChanges_When_Casemapped
CWCM
Changes_When_LowercasedChanges_When_Lowercased
CWL
Changes_When_NFKC_CasefoldedChanges_When_NFKC_Casefolded
CWKCF
Changes_When_TitlecasedChanges_When_Titlecased
CWT
Changes_When_UppercasedChanges_When_Uppercased
CWU
DashDash
Default_Ignorable_Code_PointDefault_Ignorable_Code_Point
DI
DeprecatedDeprecated
Dep
DiacriticDiacritic
Dia
EmojiEmoji
Emoji_ComponentEmoji_Component
EComp
Emoji_ModifierEmoji_Modifier
EMod
Emoji_Modifier_BaseEmoji_Modifier_Base
EBase
Emoji_PresentationEmoji_Presentation
EPres
Extended_PictographicExtended_Pictographic
ExtPict
ExtenderExtender
Ext
Grapheme_BaseGrapheme_Base
Gr_Base
Grapheme_ExtendGrapheme_Extend
Gr_Ext
Hex_DigitHex_Digit
Hex
IDS_Binary_OperatorIDS_Binary_Operator
IDSB
IDS_Trinary_OperatorIDS_Trinary_Operator
IDST
ID_ContinueID_Continue
IDC
ID_StartID_Start
IDS
IdeographicIdeographic
Ideo
Join_ControlJoin_Control
Join_C
Logical_Order_ExceptionLogical_Order_Exception
LOE
LowercaseLowercase
Lower
MathMath
Noncharacter_Code_PointNoncharacter_Code_Point
NChar
Pattern_SyntaxPattern_Syntax
Pat_Syn
Pattern_White_SpacePattern_White_Space
Pat_WS
Quotation_MarkQuotation_Mark
QMark
RadicalRadical
Regional_IndicatorRegional_Indicator
RI
Sentence_TerminalSentence_Terminal
STerm
Soft_DottedSoft_Dotted
SD
Terminal_PunctuationTerminal_Punctuation
Term
Unified_IdeographUnified_Ideograph
UIdeo
UppercaseUppercase
Upper
Variation_SelectorVariation_Selector
VS
White_SpaceWhite_Space
space
XID_ContinueXID_Continue
XIDC
XID_StartXID_Start
XIDS
Table 69: Binary Unicode properties of strings
Property name
Basic_Emoji
Emoji_Keycap_Sequence
RGI_Emoji_Modifier_Sequence
RGI_Emoji_Flag_Sequence
RGI_Emoji_Tag_Sequence
RGI_Emoji_ZWJ_Sequence
RGI_Emoji

22.2.2.9.8 UnicodeMatchPropertyValue (p,v )

The abstract operation UnicodeMatchPropertyValue takes argumentsp (ECMAScript source text) andv (ECMAScript source text) and returns a Unicode property value. It performs the following steps when called:

  1. Assert:p is a canonical, unaliasedUnicode property name listed in the “Canonical property name” column ofTable 67.
  2. Assert:v is a property value or property value alias for the Unicode propertyp listed inPropertyValueAliases.txt.
  3. Letvalue be the canonical property value ofv as given in the “Canonical property value” column of the corresponding row.
  4. Return theList of Unicode code pointsvalue.

Implementations must support the Unicode property values and property value aliases listed inPropertyValueAliases.txt for the properties listed inTable 67. To ensure interoperability, implementations must not support any other property values or property value aliases.

Note 1

For example,Xpeo andOld_Persian are validScript_Extensions values, butxpeo andOld Persian aren't.

Note 2

This algorithm differs fromthe matching rules for symbolic values listed in UAX44: case,white space, U+002D (HYPHEN-MINUS), and U+005F (LOW LINE) are not ignored, and theIs prefix is not supported.

22.2.2.10 Runtime Semantics: CompileClassSetString

Thesyntax-directed operation CompileClassSetString takes argumentrer (aRegExp Record) and returns a sequence of characters. It is defined piecewise over the following productions:

ClassString::[empty]
  1. Return an empty sequence of characters.
ClassString::NonEmptyClassString
  1. ReturnCompileClassSetString ofNonEmptyClassString with argumentrer.
NonEmptyClassString::ClassSetCharacterNonEmptyClassStringopt
  1. Letcs beCompileToCharSet ofClassSetCharacter with argumentrer.
  2. Lets1 be the sequence of characters that is the singleCharSetElement ofcs.
  3. IfNonEmptyClassString is present, then
    1. Lets2 beCompileClassSetString ofNonEmptyClassString with argumentrer.
    2. Return the concatenation ofs1 ands2.
  4. Returns1.

22.2.3 Abstract Operations for RegExp Creation

22.2.3.1 RegExpCreate (P,F )

The abstract operation RegExpCreate takes argumentsP (anECMAScript language value) andF (a String orundefined) and returns either anormal completion containing an Object or athrow completion. It performs the following steps when called:

  1. Letobj be ! RegExpAlloc(%RegExp%).
  2. Return ? RegExpInitialize(obj,P,F).

22.2.3.2 RegExpAlloc (newTarget )

The abstract operation RegExpAlloc takes argumentnewTarget (aconstructor) and returns either anormal completion containing an Object or athrow completion. It performs the following steps when called:

  1. Letobj be ? OrdinaryCreateFromConstructor(newTarget,"%RegExp.prototype%", «[[OriginalSource]],[[OriginalFlags]],[[RegExpRecord]],[[RegExpMatcher]] »).
  2. Perform ! DefinePropertyOrThrow(obj,"lastIndex", PropertyDescriptor {[[Writable]]:true,[[Enumerable]]:false,[[Configurable]]:false }).
  3. Returnobj.

22.2.3.3 RegExpInitialize (obj,pattern,flags )

The abstract operation RegExpInitialize takes argumentsobj (an Object),pattern (anECMAScript language value), andflags (anECMAScript language value) and returns either anormal completion containing an Object or athrow completion. It performs the following steps when called:

  1. Ifpattern isundefined, letP be the empty String.
  2. Else, letP be ? ToString(pattern).
  3. Ifflags isundefined, letF be the empty String.
  4. Else, letF be ? ToString(flags).
  5. IfF contains any code unit other than"d","g","i","m","s","u","v", or"y", or ifF contains any code unit more than once, throw aSyntaxError exception.
  6. IfF contains"i", leti betrue; else leti befalse.
  7. IfF contains"m", letm betrue; else letm befalse.
  8. IfF contains"s", lets betrue; else lets befalse.
  9. IfF contains"u", letu betrue; else letu befalse.
  10. IfF contains"v", letv betrue; else letv befalse.
  11. Ifu istrue orv istrue, then
    1. LetpatternText beStringToCodePoints(P).
  12. Else,
    1. LetpatternText be the result of interpreting each ofP's 16-bit elements as a Unicode BMP code point. UTF-16 decoding is not applied to the elements.
  13. LetparseResult beParsePattern(patternText,u,v).
  14. IfparseResult is a non-emptyList ofSyntaxError objects, throw aSyntaxError exception.
  15. Assert:parseResult is aPatternParse Node.
  16. Setobj.[[OriginalSource]] toP.
  17. Setobj.[[OriginalFlags]] toF.
  18. LetcapturingGroupsCount beCountLeftCapturingParensWithin(parseResult).
  19. Letrer be theRegExp Record {[[IgnoreCase]]:i,[[Multiline]]:m,[[DotAll]]:s,[[Unicode]]:u,[[UnicodeSets]]:v,[[CapturingGroupsCount]]:capturingGroupsCount }.
  20. Setobj.[[RegExpRecord]] torer.
  21. Setobj.[[RegExpMatcher]] toCompilePattern ofparseResult with argumentrer.
  22. Perform ? Set(obj,"lastIndex",+0𝔽,true).
  23. Returnobj.

22.2.3.4 Static Semantics: ParsePattern (patternText,u,v )

The abstract operation ParsePattern takes argumentspatternText (a sequence of Unicode code points),u (a Boolean), andv (a Boolean) and returns aParse Node or a non-emptyList ofSyntaxError objects.

Note

This section is amended inB.1.2.9.

It performs the following steps when called:

  1. Ifv istrue andu istrue, then
    1. LetparseResult be aList containing one or moreSyntaxError objects.
  2. Else ifv istrue, then
    1. LetparseResult beParseText(patternText,Pattern[+UnicodeMode, +UnicodeSetsMode, +NamedCaptureGroups]).
  3. Else ifu istrue, then
    1. LetparseResult beParseText(patternText,Pattern[+UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups]).
  4. Else,
    1. LetparseResult beParseText(patternText,Pattern[~UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups]).
  5. ReturnparseResult.

22.2.4 The RegExp Constructor

The RegExpconstructor:

  • is%RegExp%.
  • is the initial value of the"RegExp" property of theglobal object.
  • creates and initializes a new RegExp object when called as aconstructor.
  • when called as a function rather than as aconstructor, returns either a new RegExp object, or the argument itself if the only argument is a RegExp object.
  • may be used as the value of anextends clause of a class definition. Subclassconstructors that intend to inherit the specified RegExp behaviour must include asuper call to the RegExpconstructor to create and initialize subclass instances with the necessary internal slots.

22.2.4.1 RegExp (pattern,flags )

This function performs the following steps when called:

  1. LetpatternIsRegExp be ? IsRegExp(pattern).
  2. If NewTarget isundefined, then
    1. LetnewTarget be theactive function object.
    2. IfpatternIsRegExp istrue andflags isundefined, then
      1. LetpatternConstructor be ? Get(pattern,"constructor").
      2. IfSameValue(newTarget,patternConstructor) istrue, returnpattern.
  3. Else,
    1. LetnewTarget be NewTarget.
  4. Ifpatternis an Object andpattern has a[[RegExpMatcher]] internal slot, then
    1. LetP bepattern.[[OriginalSource]].
    2. Ifflags isundefined, letF bepattern.[[OriginalFlags]].
    3. Else, letF beflags.
  5. Else ifpatternIsRegExp istrue, then
    1. LetP be ? Get(pattern,"source").
    2. Ifflags isundefined, then
      1. LetF be ? Get(pattern,"flags").
    3. Else,
      1. LetF beflags.
  6. Else,
    1. LetP bepattern.
    2. LetF beflags.
  7. LetO be ? RegExpAlloc(newTarget).
  8. Return ? RegExpInitialize(O,P,F).
Note

If pattern is supplied using aStringLiteral, the usual escape sequence substitutions are performed before the String is processed by this function. If pattern must contain an escape sequence to be recognized by this function, any U+005C (REVERSE SOLIDUS) code points must be escaped within theStringLiteral to prevent them being removed when the contents of theStringLiteral are formed.

22.2.5 Properties of the RegExp Constructor

The RegExpconstructor:

22.2.5.1 RegExp.escape (S )

This function returns a copy ofS in which characters that are potentially special in a regular expressionPattern have been replaced by equivalent escape sequences.

It performs the following steps when called:

  1. IfSis not a String, throw aTypeError exception.
  2. Letescaped be the empty String.
  3. LetcpList beStringToCodePoints(S).
  4. For each code pointcp ofcpList, do
    1. Ifescaped is the empty String andcp is matched by eitherDecimalDigit orAsciiLetter, then
      1. NOTE: Escaping a leading digit ensures that output corresponds with pattern text which may be used after a\0 character escape or aDecimalEscape such as\1 and still matchS rather than be interpreted as an extension of the preceding escape sequence. Escaping a leading ASCII letter does the same for the context after\c.
      2. LetnumericValue be the numeric value ofcp.
      3. Lethex beNumber::toString(𝔽(numericValue), 16).
      4. Assert: The length ofhex is 2.
      5. Setescaped to thestring-concatenation of the code unit 0x005C (REVERSE SOLIDUS),"x", andhex.
    2. Else,
      1. Setescaped to thestring-concatenation ofescaped andEncodeForRegExpEscape(cp).
  5. Returnescaped.
Note

Despite having similar names,EscapeRegExpPattern andRegExp.escape do not perform similar actions. The former escapes a pattern for representation as a string, while this function escapes a string for representation inside a pattern.

22.2.5.1.1 EncodeForRegExpEscape (cp )

The abstract operation EncodeForRegExpEscape takes argumentcp (a code point) and returns a String. It returns a String representing aPattern for matchingcp. Ifcp is white space or an ASCII punctuator, the returned value is an escape sequence. Otherwise, the returned valueis a String representation ofcp itself. It performs the following steps when called:

  1. Ifcp is matched bySyntaxCharacter orcp is U+002F (SOLIDUS), then
    1. Return thestring-concatenation of 0x005C (REVERSE SOLIDUS) andUTF16EncodeCodePoint(cp).
  2. Else ifcp is a code point listed in the “Code Point” column ofTable 65, then
    1. Return thestring-concatenation of 0x005C (REVERSE SOLIDUS) and the string in the “ControlEscape” column of the row whose “Code Point” column containscp.
  3. LetotherPunctuators be thestring-concatenation of",-=<>#&!%:;@~'`" and the code unit 0x0022 (QUOTATION MARK).
  4. LettoEscape beStringToCodePoints(otherPunctuators).
  5. IftoEscape containscp,cp is matched by eitherWhiteSpace orLineTerminator, orcp has the same numeric value as aleading surrogate ortrailing surrogate, then
    1. LetcpNum be the numeric value ofcp.
    2. IfcpNum ≤ 0xFF, then
      1. Lethex beNumber::toString(𝔽(cpNum), 16).
      2. Return thestring-concatenation of the code unit 0x005C (REVERSE SOLIDUS),"x", andStringPad(hex, 2,"0",start).
    3. Letescaped be the empty String.
    4. LetcodeUnits beUTF16EncodeCodePoint(cp).
    5. For each code unitcu ofcodeUnits, do
      1. Setescaped to thestring-concatenation ofescaped andUnicodeEscape(cu).
    6. Returnescaped.
  6. ReturnUTF16EncodeCodePoint(cp).

22.2.5.2 RegExp.prototype

The initial value ofRegExp.prototype is theRegExp prototype object.

This property has the attributes {[[Writable]]:false,[[Enumerable]]:false,[[Configurable]]:false }.

22.2.5.3 get RegExp [ %Symbol.species% ]

RegExp[%Symbol.species%] is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. Return thethis value.

The value of the"name" property of this function is"get [Symbol.species]".

Note

RegExp prototype methods normally use theirthis value'sconstructor to create a derived object. However, a subclassconstructor may over-ride that default behaviour by redefining its%Symbol.species% property.

22.2.6 Properties of the RegExp Prototype Object

TheRegExp prototype object:

  • is%RegExp.prototype%.
  • is anordinary object.
  • is not a RegExp instance and does not have a[[RegExpMatcher]] internal slot or any of the other internal slots of RegExp instance objects.
  • has a[[Prototype]] internal slot whose value is%Object.prototype%.
Note

The RegExp prototype object does not have a"valueOf" property of its own; however, it inherits the"valueOf" property from theObject prototype object.

22.2.6.1 RegExp.prototype.constructor

The initial value ofRegExp.prototype.constructor is%RegExp%.

22.2.6.2 RegExp.prototype.exec (string )

This method searchesstring for an occurrence of the regular expression pattern and returns an Array containing the results of the match, ornull ifstring did not match.

It performs the following steps when called:

  1. LetR be thethis value.
  2. Perform ? RequireInternalSlot(R,[[RegExpMatcher]]).
  3. LetS be ? ToString(string).
  4. Return ? RegExpBuiltinExec(R,S).

22.2.6.3 get RegExp.prototype.dotAll

RegExp.prototype.dotAll is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0073 (LATIN SMALL LETTER S).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.4 get RegExp.prototype.flags

RegExp.prototype.flags is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. IfRis not an Object, throw aTypeError exception.
  3. LetcodeUnits be a new emptyList.
  4. LethasIndices beToBoolean(?Get(R,"hasIndices")).
  5. IfhasIndices istrue, append the code unit 0x0064 (LATIN SMALL LETTER D) tocodeUnits.
  6. Letglobal beToBoolean(?Get(R,"global")).
  7. Ifglobal istrue, append the code unit 0x0067 (LATIN SMALL LETTER G) tocodeUnits.
  8. LetignoreCase beToBoolean(?Get(R,"ignoreCase")).
  9. IfignoreCase istrue, append the code unit 0x0069 (LATIN SMALL LETTER I) tocodeUnits.
  10. Letmultiline beToBoolean(?Get(R,"multiline")).
  11. Ifmultiline istrue, append the code unit 0x006D (LATIN SMALL LETTER M) tocodeUnits.
  12. LetdotAll beToBoolean(?Get(R,"dotAll")).
  13. IfdotAll istrue, append the code unit 0x0073 (LATIN SMALL LETTER S) tocodeUnits.
  14. Letunicode beToBoolean(?Get(R,"unicode")).
  15. Ifunicode istrue, append the code unit 0x0075 (LATIN SMALL LETTER U) tocodeUnits.
  16. LetunicodeSets beToBoolean(?Get(R,"unicodeSets")).
  17. IfunicodeSets istrue, append the code unit 0x0076 (LATIN SMALL LETTER V) tocodeUnits.
  18. Letsticky beToBoolean(?Get(R,"sticky")).
  19. Ifsticky istrue, append the code unit 0x0079 (LATIN SMALL LETTER Y) tocodeUnits.
  20. Return the String value whose code units are the elements of theListcodeUnits. IfcodeUnits has no elements, the empty String is returned.

22.2.6.4.1 RegExpHasFlag (R,codeUnit )

The abstract operation RegExpHasFlag takes argumentsR (anECMAScript language value) andcodeUnit (a code unit) and returns either anormal completion containing either a Boolean orundefined, or athrow completion. It performs the following steps when called:

  1. IfRis not an Object, throw aTypeError exception.
  2. IfR does not have an[[OriginalFlags]] internal slot, then
    1. IfSameValue(R,%RegExp.prototype%) istrue, returnundefined.
    2. Otherwise, throw aTypeError exception.
  3. Letflags beR.[[OriginalFlags]].
  4. Ifflags containscodeUnit, returntrue.
  5. Returnfalse.

22.2.6.5 get RegExp.prototype.global

RegExp.prototype.global is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0067 (LATIN SMALL LETTER G).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.6 get RegExp.prototype.hasIndices

RegExp.prototype.hasIndices is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0064 (LATIN SMALL LETTER D).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.7 get RegExp.prototype.ignoreCase

RegExp.prototype.ignoreCase is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0069 (LATIN SMALL LETTER I).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.8 RegExp.prototype [ %Symbol.match% ] (string )

This method performs the following steps when called:

  1. Letrx be thethis value.
  2. Ifrxis not an Object, throw aTypeError exception.
  3. LetS be ? ToString(string).
  4. Letflags be ? ToString(?Get(rx,"flags")).
  5. Ifflags does not contain"g", then
    1. Return ? RegExpExec(rx,S).
  6. Else,
    1. Ifflags contains"u" orflags contains"v", letfullUnicode betrue; otherwise letfullUnicode befalse.
    2. Perform ? Set(rx,"lastIndex",+0𝔽,true).
    3. LetA be ! ArrayCreate(0).
    4. Letn be 0.
    5. Repeat,
      1. Letresult be ? RegExpExec(rx,S).
      2. Ifresult isnull, then
        1. Ifn = 0, returnnull.
        2. ReturnA.
      3. Else,
        1. LetmatchStr be ? ToString(?Get(result,"0")).
        2. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(n)),matchStr).
        3. IfmatchStr is the empty String, then
          1. LetthisIndex be(?ToLength(?Get(rx,"lastIndex"))).
          2. LetnextIndex beAdvanceStringIndex(S,thisIndex,fullUnicode).
          3. Perform ? Set(rx,"lastIndex",𝔽(nextIndex),true).
        4. Setn ton + 1.

The value of the"name" property of this method is"[Symbol.match]".

Note

The%Symbol.match% property is used by theIsRegExp abstract operation to identify objects that have the basic behaviour of regular expressions. The absence of a%Symbol.match% property or the existence of such a property whose value does not Boolean coerce totrue indicates that the object is not intended to be used as a regular expression object.

22.2.6.9 RegExp.prototype [ %Symbol.matchAll% ] (string )

This method performs the following steps when called:

  1. LetR be thethis value.
  2. IfRis not an Object, throw aTypeError exception.
  3. LetS be ? ToString(string).
  4. LetC be ? SpeciesConstructor(R,%RegExp%).
  5. Letflags be ? ToString(?Get(R,"flags")).
  6. Letmatcher be ? Construct(C, «R,flags »).
  7. LetlastIndex be ? ToLength(?Get(R,"lastIndex")).
  8. Perform ? Set(matcher,"lastIndex",lastIndex,true).
  9. Ifflags contains"g", letglobal betrue.
  10. Else, letglobal befalse.
  11. Ifflags contains"u" orflags contains"v", letfullUnicode betrue.
  12. Else, letfullUnicode befalse.
  13. ReturnCreateRegExpStringIterator(matcher,S,global,fullUnicode).

The value of the"name" property of this method is"[Symbol.matchAll]".

22.2.6.10 get RegExp.prototype.multiline

RegExp.prototype.multiline is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x006D (LATIN SMALL LETTER M).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.11 RegExp.prototype [ %Symbol.replace% ] (string,replaceValue )

This method performs the following steps when called:

  1. Letrx be thethis value.
  2. Ifrxis not an Object, throw aTypeError exception.
  3. LetS be ? ToString(string).
  4. LetlengthS be the length ofS.
  5. LetfunctionalReplace beIsCallable(replaceValue).
  6. IffunctionalReplace isfalse, then
    1. SetreplaceValue to ? ToString(replaceValue).
  7. Letflags be ? ToString(?Get(rx,"flags")).
  8. Ifflags contains"g", letglobal betrue; otherwise letglobal befalse.
  9. Ifglobal istrue, then
    1. Perform ? Set(rx,"lastIndex",+0𝔽,true).
  10. Letresults be a new emptyList.
  11. Letdone befalse.
  12. Repeat, whiledone isfalse,
    1. Letresult be ? RegExpExec(rx,S).
    2. Ifresult isnull, then
      1. Setdone totrue.
    3. Else,
      1. Appendresult toresults.
      2. Ifglobal isfalse, then
        1. Setdone totrue.
      3. Else,
        1. LetmatchStr be ? ToString(?Get(result,"0")).
        2. IfmatchStr is the empty String, then
          1. LetthisIndex be(?ToLength(?Get(rx,"lastIndex"))).
          2. Ifflags contains"u" orflags contains"v", letfullUnicode betrue; otherwise letfullUnicode befalse.
          3. LetnextIndex beAdvanceStringIndex(S,thisIndex,fullUnicode).
          4. Perform ? Set(rx,"lastIndex",𝔽(nextIndex),true).
  13. LetaccumulatedResult be the empty String.
  14. LetnextSourcePosition be 0.
  15. For each elementresult ofresults, do
    1. LetresultLength be ? LengthOfArrayLike(result).
    2. LetnCaptures bemax(resultLength - 1, 0).
    3. Letmatched be ? ToString(?Get(result,"0")).
    4. LetmatchLength be the length ofmatched.
    5. Letposition be ? ToIntegerOrInfinity(?Get(result,"index")).
    6. Setposition to the result ofclampingposition between 0 andlengthS.
    7. Letcaptures be a new emptyList.
    8. Letn be 1.
    9. Repeat, whilennCaptures,
      1. LetcapN be ? Get(result, ! ToString(𝔽(n))).
      2. IfcapN is notundefined, then
        1. SetcapN to ? ToString(capN).
      3. AppendcapN tocaptures.
      4. NOTE: Whenn = 1, the preceding step puts the first element intocaptures (at index 0). More generally, thenth capture (the characters captured by thenth set of capturing parentheses) is atcaptures[n - 1].
      5. Setn ton + 1.
    10. LetnamedCaptures be ? Get(result,"groups").
    11. IffunctionalReplace istrue, then
      1. LetreplacerArgs be thelist-concatenation of «matched »,captures, and «𝔽(position),S ».
      2. IfnamedCaptures is notundefined, then
        1. AppendnamedCaptures toreplacerArgs.
      3. LetreplacementValue be ? Call(replaceValue,undefined,replacerArgs).
      4. LetreplacementString be ? ToString(replacementValue).
    12. Else,
      1. IfnamedCaptures is notundefined, then
        1. SetnamedCaptures to ? ToObject(namedCaptures).
      2. LetreplacementString be ? GetSubstitution(matched,S,position,captures,namedCaptures,replaceValue).
    13. IfpositionnextSourcePosition, then
      1. NOTE:position should not normally move backwards. If it does, it is an indication of an ill-behaving RegExp subclass or use of an access triggered side-effect to change the global flag or other characteristics ofrx. In such cases, the corresponding substitution is ignored.
      2. SetaccumulatedResult to thestring-concatenation ofaccumulatedResult, thesubstring ofS fromnextSourcePosition toposition, andreplacementString.
      3. SetnextSourcePosition toposition +matchLength.
  16. IfnextSourcePositionlengthS, returnaccumulatedResult.
  17. Return thestring-concatenation ofaccumulatedResult and thesubstring ofS fromnextSourcePosition.

The value of the"name" property of this method is"[Symbol.replace]".

22.2.6.12 RegExp.prototype [ %Symbol.search% ] (string )

This method performs the following steps when called:

  1. Letrx be thethis value.
  2. Ifrxis not an Object, throw aTypeError exception.
  3. LetS be ? ToString(string).
  4. LetpreviousLastIndex be ? Get(rx,"lastIndex").
  5. IfpreviousLastIndex is not+0𝔽, then
    1. Perform ? Set(rx,"lastIndex",+0𝔽,true).
  6. Letresult be ? RegExpExec(rx,S).
  7. LetcurrentLastIndex be ? Get(rx,"lastIndex").
  8. IfSameValue(currentLastIndex,previousLastIndex) isfalse, then
    1. Perform ? Set(rx,"lastIndex",previousLastIndex,true).
  9. Ifresult isnull, return-1𝔽.
  10. Return ? Get(result,"index").

The value of the"name" property of this method is"[Symbol.search]".

Note

The"lastIndex" and"global" properties of this RegExp object are ignored when performing the search. The"lastIndex" property is left unchanged.

22.2.6.13 get RegExp.prototype.source

RegExp.prototype.source is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. IfRis not an Object, throw aTypeError exception.
  3. IfR does not have an[[OriginalSource]] internal slot, then
    1. IfSameValue(R,%RegExp.prototype%) istrue, return"(?:)".
    2. Otherwise, throw aTypeError exception.
  4. Assert:R has an[[OriginalFlags]] internal slot.
  5. Letsrc beR.[[OriginalSource]].
  6. Letflags beR.[[OriginalFlags]].
  7. ReturnEscapeRegExpPattern(src,flags).

22.2.6.13.1 EscapeRegExpPattern (P,F )

The abstract operation EscapeRegExpPattern takes argumentsP (a String) andF (a String) and returns a String. It performs the following steps when called:

  1. IfF contains"v", then
    1. LetpatternSymbol bePattern[+UnicodeMode, +UnicodeSetsMode].
  2. Else ifF contains"u", then
    1. LetpatternSymbol bePattern[+UnicodeMode, ~UnicodeSetsMode].
  3. Else,
    1. LetpatternSymbol bePattern[~UnicodeMode, ~UnicodeSetsMode].
  4. LetS be a String in the form of apatternSymbol equivalent toP interpreted as UTF-16 encoded Unicode code points (6.1.4), in which certain code points are escaped as described below.S may or may not differ fromP; however, theAbstract Closure that would result from evaluatingS as apatternSymbol must behave identically to theAbstract Closure given by the constructed object's[[RegExpMatcher]] internal slot. Multiple calls to this abstract operation using the same values forP andF must produce identical results.
  5. The code points/ or anyLineTerminator occurring in the pattern shall be escaped inS as necessary to ensure that thestring-concatenation of"/",S,"/", andF can be parsed (in an appropriate lexical context) as aRegularExpressionLiteral that behaves identically to the constructed regular expression. For example, ifP is"/", thenS could be"\/" or"\u002F", among other possibilities, but not"/", because/// followed byF would be parsed as aSingleLineComment rather than aRegularExpressionLiteral. IfP is the empty String, this specification can be met by lettingS be"(?:)".
  6. ReturnS.
Note

Despite having similar names,RegExp.escape and EscapeRegExpPattern do not perform similar actions. The former escapes a string for representation inside a pattern, while this function escapes a pattern for representation as a string.

22.2.6.14 RegExp.prototype [ %Symbol.split% ] (string,limit )

Note 1

This method returns an Array into which substrings of the result of convertingstring to a String have been stored. The substrings are determined by searching from left to right for matches of thethis value regular expression; these occurrences are not part of any String in the returned array, but serve to divide up the String value.

Thethis value may be an empty regular expression or a regular expression that can match an empty String. In this case, the regular expression does not match the emptysubstring at the beginning or end of the input String, nor does it match the emptysubstring at the end of the previous separator match. (For example, if the regular expression matches the empty String, the String is split up into individual code unit elements; the length of the result array equals the length of the String, and eachsubstring contains one code unit.) Only the first match at a given index of the String is considered, even if backtracking could yield a non-emptysubstring match at that index. (For example,/a*?/[Symbol.split]("ab") evaluates to the array["a", "b"], while/a*/[Symbol.split]("ab") evaluates to the array["","b"].)

Ifstring is (or converts to) the empty String, the result depends on whether the regular expression can match the empty String. If it can, the result array contains no elements. Otherwise, the result array contains one element, which is the empty String.

If the regular expression contains capturing parentheses, then each timeseparator is matched the results (including anyundefined results) of the capturing parentheses are spliced into the output array. For example,

/<(\/)?([^<>]+)>/[Symbol.split]("A<B>bold</B>and<CODE>coded</CODE>")

evaluates to the array

["A",undefined,"B","bold","/","B","and",undefined,"CODE","coded","/","CODE",""]

Iflimit is notundefined, then the output array is truncated so that it contains no more thanlimit elements.

This method performs the following steps when called:

  1. Letrx be thethis value.
  2. Ifrxis not an Object, throw aTypeError exception.
  3. LetS be ? ToString(string).
  4. LetC be ? SpeciesConstructor(rx,%RegExp%).
  5. Letflags be ? ToString(?Get(rx,"flags")).
  6. Ifflags contains"u" orflags contains"v", letunicodeMatching betrue.
  7. Else, letunicodeMatching befalse.
  8. Ifflags contains"y", letnewFlags beflags.
  9. Else, letnewFlags be thestring-concatenation offlags and"y".
  10. Letsplitter be ? Construct(C, «rx,newFlags »).
  11. LetA be ! ArrayCreate(0).
  12. LetlengthA be 0.
  13. Iflimit isundefined, letlim be 232 - 1; else letlim be(?ToUint32(limit)).
  14. Iflim = 0, returnA.
  15. IfS is the empty String, then
    1. Letz be ? RegExpExec(splitter,S).
    2. Ifz is notnull, returnA.
    3. Perform ! CreateDataPropertyOrThrow(A,"0",S).
    4. ReturnA.
  16. Letsize be the length ofS.
  17. Letp be 0.
  18. Letq bep.
  19. Repeat, whileq <size,
    1. Perform ? Set(splitter,"lastIndex",𝔽(q),true).
    2. Letz be ? RegExpExec(splitter,S).
    3. Ifz isnull, then
      1. Setq toAdvanceStringIndex(S,q,unicodeMatching).
    4. Else,
      1. Lete be(?ToLength(?Get(splitter,"lastIndex"))).
      2. Sete tomin(e,size).
      3. Ife =p, then
        1. Setq toAdvanceStringIndex(S,q,unicodeMatching).
      4. Else,
        1. LetT be thesubstring ofS fromp toq.
        2. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(lengthA)),T).
        3. SetlengthA tolengthA + 1.
        4. IflengthA =lim, returnA.
        5. Setp toe.
        6. LetnumberOfCaptures be ? LengthOfArrayLike(z).
        7. SetnumberOfCaptures tomax(numberOfCaptures - 1, 0).
        8. Leti be 1.
        9. Repeat, whileinumberOfCaptures,
          1. LetnextCapture be ? Get(z, ! ToString(𝔽(i))).
          2. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(lengthA)),nextCapture).
          3. Seti toi + 1.
          4. SetlengthA tolengthA + 1.
          5. IflengthA =lim, returnA.
        10. Setq top.
  20. LetT be thesubstring ofS fromp tosize.
  21. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(lengthA)),T).
  22. ReturnA.

The value of the"name" property of this method is"[Symbol.split]".

Note 2

This method ignores the value of the"global" and"sticky" properties of this RegExp object.

22.2.6.15 get RegExp.prototype.sticky

RegExp.prototype.sticky is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0079 (LATIN SMALL LETTER Y).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.16 RegExp.prototype.test (S )

This method performs the following steps when called:

  1. LetR be thethis value.
  2. IfRis not an Object, throw aTypeError exception.
  3. Letstring be ? ToString(S).
  4. Letmatch be ? RegExpExec(R,string).
  5. Ifmatch is notnull, returntrue; else returnfalse.

22.2.6.17 RegExp.prototype.toString ( )

  1. LetR be thethis value.
  2. IfRis not an Object, throw aTypeError exception.
  3. Letpattern be ? ToString(?Get(R,"source")).
  4. Letflags be ? ToString(?Get(R,"flags")).
  5. Letresult be thestring-concatenation of"/",pattern,"/", andflags.
  6. Returnresult.
Note

The returned String has the form of aRegularExpressionLiteral that evaluates to another RegExp object with the same behaviour as this object.

22.2.6.18 get RegExp.prototype.unicode

RegExp.prototype.unicode is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0075 (LATIN SMALL LETTER U).
  3. Return ? RegExpHasFlag(R,cu).

22.2.6.19 get RegExp.prototype.unicodeSets

RegExp.prototype.unicodeSets is anaccessor property whose set accessor function isundefined. Its get accessor function performs the following steps when called:

  1. LetR be thethis value.
  2. Letcu be the code unit 0x0076 (LATIN SMALL LETTER V).
  3. Return ? RegExpHasFlag(R,cu).

22.2.7 Abstract Operations for RegExp Matching

22.2.7.1 RegExpExec (R,S )

The abstract operation RegExpExec takes argumentsR (an Object) andS (a String) and returns either anormal completion containing either an Object ornull, or athrow completion. It performs the following steps when called:

  1. Letexec be ? Get(R,"exec").
  2. IfIsCallable(exec) istrue, then
    1. Letresult be ? Call(exec,R, «S »).
    2. Ifresultis not an Object andresult is notnull, throw aTypeError exception.
    3. Returnresult.
  3. Perform ? RequireInternalSlot(R,[[RegExpMatcher]]).
  4. Return ? RegExpBuiltinExec(R,S).
Note

If a callable"exec" property is not found this algorithm falls back to attempting to use the built-in RegExp matching algorithm. This provides compatible behaviour for code written for prior editions where most built-in algorithms that use regular expressions did not perform a dynamic property lookup of"exec".

22.2.7.2 RegExpBuiltinExec (R,S )

The abstract operation RegExpBuiltinExec takes argumentsR (an initialized RegExp instance) andS (a String) and returns either anormal completion containing either anArray exotic object ornull, or athrow completion. It performs the following steps when called:

  1. Letlength be the length ofS.
  2. LetlastIndex be(?ToLength(!Get(R,"lastIndex"))).
  3. Letflags beR.[[OriginalFlags]].
  4. Ifflags contains"g", letglobal betrue; else letglobal befalse.
  5. Ifflags contains"y", letsticky betrue; else letsticky befalse.
  6. Ifflags contains"d", lethasIndices betrue; else lethasIndices befalse.
  7. Ifglobal isfalse andsticky isfalse, setlastIndex to 0.
  8. Letmatcher beR.[[RegExpMatcher]].
  9. Ifflags contains"u" orflags contains"v", letfullUnicode betrue; else letfullUnicode befalse.
  10. LetmatchSucceeded befalse.
  11. IffullUnicode istrue, letinput beStringToCodePoints(S); otherwise letinput be aList whose elements are the code units that are the elements ofS.
  12. NOTE: Each element ofinput is considered to be a character.
  13. Repeat, whilematchSucceeded isfalse,
    1. IflastIndex >length, then
      1. Ifglobal istrue orsticky istrue, then
        1. Perform ? Set(R,"lastIndex",+0𝔽,true).
      2. Returnnull.
    2. LetinputIndex be the index intoinput of the character that was obtained from elementlastIndex ofS.
    3. Letr bematcher(input,inputIndex).
    4. Ifr isfailure, then
      1. Ifsticky istrue, then
        1. Perform ? Set(R,"lastIndex",+0𝔽,true).
        2. Returnnull.
      2. SetlastIndex toAdvanceStringIndex(S,lastIndex,fullUnicode).
    5. Else,
      1. Assert:r is aMatchState.
      2. SetmatchSucceeded totrue.
  14. Lete ber.[[EndIndex]].
  15. IffullUnicode istrue, sete toGetStringIndex(S,e).
  16. Ifglobal istrue orsticky istrue, then
    1. Perform ? Set(R,"lastIndex",𝔽(e),true).
  17. Letn be the number of elements inr.[[Captures]].
  18. Assert:n =R.[[RegExpRecord]].[[CapturingGroupsCount]].
  19. Assert:n < 232 - 1.
  20. LetA be ! ArrayCreate(n + 1).
  21. Assert: Themathematical value ofA's"length" property isn + 1.
  22. Perform ! CreateDataPropertyOrThrow(A,"index",𝔽(lastIndex)).
  23. Perform ! CreateDataPropertyOrThrow(A,"input",S).
  24. Letmatch be theMatch Record {[[StartIndex]]:lastIndex,[[EndIndex]]:e }.
  25. Letindices be a new emptyList.
  26. LetgroupNames be a new emptyList.
  27. Appendmatch toindices.
  28. LetmatchedSubstr beGetMatchString(S,match).
  29. Perform ! CreateDataPropertyOrThrow(A,"0",matchedSubstr).
  30. IfR contains anyGroupName, then
    1. Letgroups beOrdinaryObjectCreate(null).
    2. LethasGroups betrue.
  31. Else,
    1. Letgroups beundefined.
    2. LethasGroups befalse.
  32. Perform ! CreateDataPropertyOrThrow(A,"groups",groups).
  33. LetmatchedGroupNames be a new emptyList.
  34. For eachintegeri such that 1 ≤in, in ascending order, do
    1. LetcaptureI beith element ofr.[[Captures]].
    2. IfcaptureI isundefined, then
      1. LetcapturedValue beundefined.
      2. Appendundefined toindices.
    3. Else,
      1. LetcaptureStart becaptureI.[[StartIndex]].
      2. LetcaptureEnd becaptureI.[[EndIndex]].
      3. IffullUnicode istrue, then
        1. SetcaptureStart toGetStringIndex(S,captureStart).
        2. SetcaptureEnd toGetStringIndex(S,captureEnd).
      4. Letcapture be theMatch Record {[[StartIndex]]:captureStart,[[EndIndex]]:captureEnd }.
      5. LetcapturedValue beGetMatchString(S,capture).
      6. Appendcapture toindices.
    4. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(i)),capturedValue).
    5. If theith capture ofR was defined with aGroupName, then
      1. Lets be theCapturingGroupName of thatGroupName.
      2. IfmatchedGroupNames containss, then
        1. Assert:capturedValue isundefined.
        2. Appendundefined togroupNames.
      3. Else,
        1. IfcapturedValue is notundefined, appends tomatchedGroupNames.
        2. NOTE: If there are multiple groups nameds,groups may already have ans property at this point. However, becausegroups is anordinary object whose properties are all writabledata properties, the call toCreateDataPropertyOrThrow is nevertheless guaranteed to succeed.
        3. Perform ! CreateDataPropertyOrThrow(groups,s,capturedValue).
        4. Appends togroupNames.
    6. Else,
      1. Appendundefined togroupNames.
  35. IfhasIndices istrue, then
    1. LetindicesArray beMakeMatchIndicesIndexPairArray(S,indices,groupNames,hasGroups).
    2. Perform ! CreateDataPropertyOrThrow(A,"indices",indicesArray).
  36. ReturnA.

22.2.7.3 AdvanceStringIndex (S,index,unicode )

The abstract operation AdvanceStringIndex takes argumentsS (a String),index (a non-negativeinteger), andunicode (a Boolean) and returns aninteger. It performs the following steps when called:

  1. Assert:index ≤ 253 - 1.
  2. Ifunicode isfalse, returnindex + 1.
  3. Letlength be the length ofS.
  4. Ifindex + 1 ≥length, returnindex + 1.
  5. Letcp beCodePointAt(S,index).
  6. Returnindex +cp.[[CodeUnitCount]].

22.2.7.4 GetStringIndex (S,codePointIndex )

The abstract operation GetStringIndex takes argumentsS (a String) andcodePointIndex (a non-negativeinteger) and returns a non-negativeinteger. It interpretsS as a sequence of UTF-16 encoded code points, as described in6.1.4, and returns the code unit index corresponding to code point indexcodePointIndex when such an index exists. Otherwise, it returns the length ofS. It performs the following steps when called:

  1. IfS is the empty String, return 0.
  2. Letlen be the length ofS.
  3. LetcodeUnitCount be 0.
  4. LetcodePointCount be 0.
  5. Repeat, whilecodeUnitCount <len,
    1. IfcodePointCount =codePointIndex, returncodeUnitCount.
    2. Letcp beCodePointAt(S,codeUnitCount).
    3. SetcodeUnitCount tocodeUnitCount +cp.[[CodeUnitCount]].
    4. SetcodePointCount tocodePointCount + 1.
  6. Returnlen.

22.2.7.5 Match Records

AMatch Record is aRecord value used to encapsulate the start and end indices of a regular expression match or capture.

Match Records have the fields listed inTable 70.

Table 70:Match Record Fields
Field NameValueMeaning
[[StartIndex]]a non-negativeintegerThe number of code units from the start of a string at which the match begins (inclusive).
[[EndIndex]]aninteger[[StartIndex]]The number of code units from the start of a string at which the match ends (exclusive).

22.2.7.6 GetMatchString (S,match )

The abstract operation GetMatchString takes argumentsS (a String) andmatch (aMatch Record) and returns a String. It performs the following steps when called:

  1. Assert:match.[[StartIndex]]match.[[EndIndex]] ≤ the length ofS.
  2. Return thesubstring ofS frommatch.[[StartIndex]] tomatch.[[EndIndex]].

22.2.7.7 GetMatchIndexPair (S,match )

The abstract operation GetMatchIndexPair takes argumentsS (a String) andmatch (aMatch Record) and returns an Array. It performs the following steps when called:

  1. Assert:match.[[StartIndex]]match.[[EndIndex]] ≤ the length ofS.
  2. ReturnCreateArrayFromList𝔽(match.[[StartIndex]]),𝔽(match.[[EndIndex]]) »).

22.2.7.8 MakeMatchIndicesIndexPairArray (S,indices,groupNames,hasGroups )

The abstract operation MakeMatchIndicesIndexPairArray takes argumentsS (a String),indices (aList of eitherMatch Records orundefined),groupNames (aList of either Strings orundefined), andhasGroups (a Boolean) and returns an Array. It performs the following steps when called:

  1. Letn be the number of elements inindices.
  2. Assert:n < 232 - 1.
  3. Assert:groupNames hasn - 1 elements.
  4. NOTE: ThegroupNamesList contains elements aligned with theindicesList starting atindices[1].
  5. LetA be ! ArrayCreate(n).
  6. IfhasGroups istrue, then
    1. Letgroups beOrdinaryObjectCreate(null).
  7. Else,
    1. Letgroups beundefined.
  8. Perform ! CreateDataPropertyOrThrow(A,"groups",groups).
  9. For eachintegeri such that 0 ≤i <n, in ascending order, do
    1. LetmatchIndices beindices[i].
    2. IfmatchIndices is notundefined, then
      1. LetmatchIndexPair beGetMatchIndexPair(S,matchIndices).
    3. Else,
      1. LetmatchIndexPair beundefined.
    4. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(i)),matchIndexPair).
    5. Ifi > 0, then
      1. Lets begroupNames[i - 1].
      2. Ifs is notundefined, then
        1. Assert:groups is notundefined.
        2. NOTE: If there are multiple groups nameds,groups may already have ans property at this point. However, becausegroups is anordinary object whose properties are all writabledata properties, the call toCreateDataPropertyOrThrow is nevertheless guaranteed to succeed.
        3. Perform ! CreateDataPropertyOrThrow(groups,s,matchIndexPair).
  10. ReturnA.

22.2.8 Properties of RegExp Instances

RegExp instances areordinary objects that inherit properties from theRegExp prototype object. RegExp instances have internal slots[[OriginalSource]],[[OriginalFlags]],[[RegExpRecord]], and[[RegExpMatcher]]. The value of the[[RegExpMatcher]] internal slot is anAbstract Closure representation of thePattern of the RegExp object.

Note

Prior to ECMAScript 2015, RegExp instances were specified as having the owndata properties"source","global","ignoreCase", and"multiline". Those properties are now specified asaccessor properties ofRegExp.prototype.

RegExp instances also have the following property:

22.2.8.1 lastIndex

The value of the"lastIndex" property specifies the String index at which to start the next match. It is coerced to anintegral Number when used (see22.2.7.2). This property shall have the attributes {[[Writable]]:true,[[Enumerable]]:false,[[Configurable]]:false }.

22.2.9 RegExp String Iterator Objects

ARegExp String Iterator is an object that represents a specific iteration over some specific String instance object, matching against some specific RegExp instance object. There is not a namedconstructor for RegExp String Iterator objects. Instead, RegExp String Iterator objects are created by calling certain methods of RegExp instance objects.

22.2.9.1 CreateRegExpStringIterator (R,S,global,fullUnicode )

The abstract operation CreateRegExpStringIterator takes argumentsR (an Object),S (a String),global (a Boolean), andfullUnicode (a Boolean) and returns an Object. It performs the following steps when called:

  1. Letiterator beOrdinaryObjectCreate(%RegExpStringIteratorPrototype%, «[[IteratingRegExp]],[[IteratedString]],[[Global]],[[Unicode]],[[Done]] »).
  2. Setiterator.[[IteratingRegExp]] toR.
  3. Setiterator.[[IteratedString]] toS.
  4. Setiterator.[[Global]] toglobal.
  5. Setiterator.[[Unicode]] tofullUnicode.
  6. Setiterator.[[Done]] tofalse.
  7. Returniterator.

22.2.9.2 The %RegExpStringIteratorPrototype% Object

The%RegExpStringIteratorPrototype% object:

22.2.9.2.1 %RegExpStringIteratorPrototype%.next ( )

  1. LetO be thethis value.
  2. IfOis not an Object, throw aTypeError exception.
  3. IfO does not have all of the internal slots of aRegExp String Iterator Object Instance (see22.2.9.3), throw aTypeError exception.
  4. IfO.[[Done]] istrue, then
    1. ReturnCreateIteratorResultObject(undefined,true).
  5. LetR beO.[[IteratingRegExp]].
  6. LetS beO.[[IteratedString]].
  7. Letglobal beO.[[Global]].
  8. LetfullUnicode beO.[[Unicode]].
  9. Letmatch be ? RegExpExec(R,S).
  10. Ifmatch isnull, then
    1. SetO.[[Done]] totrue.
    2. ReturnCreateIteratorResultObject(undefined,true).
  11. Ifglobal isfalse, then
    1. SetO.[[Done]] totrue.
    2. ReturnCreateIteratorResultObject(match,false).
  12. LetmatchStr be ? ToString(?Get(match,"0")).
  13. IfmatchStr is the empty String, then
    1. LetthisIndex be(?ToLength(?Get(R,"lastIndex"))).
    2. LetnextIndex beAdvanceStringIndex(S,thisIndex,fullUnicode).
    3. Perform ? Set(R,"lastIndex",𝔽(nextIndex),true).
  14. ReturnCreateIteratorResultObject(match,false).

22.2.9.2.2 %RegExpStringIteratorPrototype% [ %Symbol.toStringTag% ]

The initial value of the%Symbol.toStringTag% property is the String value"RegExp String Iterator".

This property has the attributes {[[Writable]]:false,[[Enumerable]]:false,[[Configurable]]:true }.

22.2.9.3 Properties of RegExp String Iterator Instances

RegExp String Iterator instances areordinary objects that inherit properties from the%RegExpStringIteratorPrototype% intrinsic object.RegExp String Iterator instances are initially created with the internal slots listed inTable 71.

Table 71: Internal Slots ofRegExp String Iterator Instances
Internal SlotTypeDescription
[[IteratingRegExp]]an ObjectThe regular expression used for iteration.IsRegExp([[IteratingRegExp]]) is initiallytrue.
[[IteratedString]]a StringThe String value being iterated upon.
[[Global]]a BooleanIndicates whether the[[IteratingRegExp]] is global or not.
[[Unicode]]a BooleanIndicates whether the[[IteratingRegExp]] is in Unicode mode or not.
[[Done]]a BooleanIndicates whether the iteration is complete or not.

[8]ページ先頭

©2009-2025 Movatter.jp