ECMA-262 5th Edition in HTML Format
Section Table Of Contents
This HTML file is NOT the official
ECMAScript Language Specification


The official specification is the PDF Document located at:
http://www.ecma-international.org/publications/standards/Ecma-262.htm
Ecma Standards and Technical Reports are made available to all interested persons or organizations, free of charge and copyright, in printed form and, as files in Acrobat ® PDF format.
For more information, see http://www.ecma-international.org/publications/index.html

This version was created by Richard Mallonée. It is released under the same terms as the original ECMAScript Language Specification. Send comments and errata to:
postmaster @ ecma262-5 . com (remove spaces).

This HTML file was created through manual conversion of the official PDF version.
  • It was created to make the ECMAScript standard more accessible and to allow references to specific sections through the use of hyperlinks.
  • It may contain errors and the official standard should be used for definitive purposes.
  • It is designed to provide a web-based visual presentation that is identical to the official PDF file, and is fully linkable.
  • The document validates perfectly as Strict mode HTML.
  • The document renders identically on all major contemporary browsers.
  • The Table Of Contents contains ALL lower-level sections.
  • The text is identical to the official PDF file except it also incorporates the errata, detailed at ELS5_HTML_Errata.htm.
Additional information is available at ELS5_Info.htm.

The full online specification is available at ELS5_HTML.htm


Last update: June, 2015



ContentsPage

Introduction xii 1Scope 1 2Conformance 1 3Normative references 1 4Overview1 4.1Web Scripting2 4.2Language Overview2 4.2.1Objects3 4.2.2The Strict Variant of ECMAScript4 4.3Definitions4 4.3.1type4 4.3.2primitive value4 4.3.3object4 4.3.4constructor5 4.3.5prototype5 4.3.6native object5 4.3.7built-in object5 4.3.8host object5 4.3.1undefined value5 4.3.10Undefined type5 4.3.11null value5 4.3.12Null type5 4.3.13Boolean value5 4.3.14Boolean type6 4.3.15Boolean object6 4.3.16String value6 4.3.17String type6 4.3.18String object6 4.3.19Number value6 4.3.20Number type6 4.3.21Number object6 4.3.22Infinity6 4.3.23NaN6 4.3.24function7 4.3.25built-in function7 4.3.26property7 4.3.27method7 4.3.28built-in method7 4.3.29attribute7 4.3.30own property7 4.3.31inherited property7
5Notational Conventions7 5.1Syntactic and Lexical Grammars7 5.1.1Context-Free Grammars7 5.1.2The Lexical and RegExp Grammars8 5.1.3The Numeric String Grammar8 5.1.4The Syntactic Grammar8 5.1.5The JSON Grammar9 5.1.6Grammar Notation9 5.2Algorithm Conventions11
6Source Text12
7Lexical Conventions13 7.1Unicode Format-Control Characters14 7.2White Space14 7.3Line Terminators15 7.4Comments16 7.5Tokens17
7.6Identifier Names and Identifiers17 7.6.1Reserved Words18 7.7Punctuators19 7.8Literals19 7.8.1Null Literals19 7.8.2Boolean Literals20 7.8.3Numeric Literals20 7.8.4String Literals22 7.8.5Regular Expression Literals24 7.9Automatic Semicolon Insertion25 7.9.1Rules of Automatic Semicolon Insertion26 7.9.2Examples of Automatic Semicolon Insertion27
8Types28 8.1The Undefined Type28 8.2The Null Type28 8.3The Boolean Type28 8.4The String Type28 8.5The Number Type29 8.6The Object Type30 8.6.1Property Attributes30 8.6.2Object Internal Properties and Methods31 8.7The Reference Specification Type34 8.7.1GetValue (V)35 8.7.2PutValue (V, W)35 8.8The List Specification Type36 8.9The Completion Specification Type36 8.10The Property Descriptor and Property Identifier Specification Types37 8.10.1IsAccessorDescriptor ( Desc )37 8.10.2IsDataDescriptor ( Desc )37 8.10.3IsGenericDescriptor ( Desc )37 8.10.4FromPropertyDescriptor ( Desc )38 8.10.5ToPropertyDescriptor ( Obj )38 8.11The Lexical Environment and Environment Record Specification Types39 8.12Algorithms for Object Internal Methods39 8.12.1[[GetOwnProperty]] (P)39 8.12.2[[GetProperty]] (P)39 8.12.3[[Get]] (P)39 8.12.4[[CanPut]] (P)39 8.12.5[[Put]] ( P, V, Throw )40 8.12.6[[HasProperty]] (P)40 8.12.7[[Delete]] (P, Throw)40 8.12.8[[DefaultValue]] (hint)41 8.12.9[[DefineOwnProperty]] (P, Desc, Throw)41
9Type Conversion and Testing42 9.1ToPrimitive43 9.2ToBoolean43 9.3ToNumber43 9.3.1ToNumber Applied to the String Type44 9.4ToInteger46 9.5ToInt32: (Signed 32 Bit Integer)46 9.6ToUint32: (Unsigned 32 Bit Integer)47 9.7ToUint16: (Unsigned 16 Bit Integer)47 9.8ToString47 9.8.1ToString Applied to the Number Type48 9.9ToObject49 9.10CheckObjectCoercible49 9.11IsCallable49 9.12The SameValue Algorithm50
10Executable Code and Execution Contexts50 10.1Types of Executable Code50 10.1.1Strict Mode Code51 10.2Lexical Environments51 10.2.1Environment Records51 10.2.1.1Declarative Environment Records52 10.2.1.1.1HasBinding (N)53 10.2.1.1.2CreateMutableBinding (N, D)53 10.2.1.1.3SetMutableBinding (N,V,S)53 10.2.1.1.4GetBindingValue (N,S)53 10.2.1.1.5DeleteBinding (N)53 10.2.1.1.6ImplicitThisValue ()54 10.2.1.1.7CreateImmutableBinding (N)54 10.2.1.1.8InitializeImmutableBinding (N,V)54 10.2.1.2Object Environment Records54 10.2.1.2.1HasBinding (N)54 10.2.1.2.2CreateMutableBinding (N, D)55 10.2.1.2.3SetMutableBinding (N,V,S)55 10.2.1.2.4GetBindingValue (N,S)55 10.2.1.2.5DeleteBinding (N)55 10.2.1.2.6ImplicitThisValue ()55 10.2.2Lexical Environment Operations56 10.2.3The Global Environment56 10.3Execution Contexts56 10.3.1Identifier Resolution57 10.4Establishing an Execution Context57 10.4.1Entering Global Code58 10.4.2Entering Eval Code58 10.4.3Entering Function Code58 10.5Declaration Binding Instantiation59 10.6Arguments Object60
11Expressions62 11.1Primary Expressions62 11.1.1The this Keyword62 11.1.2Identifier Reference63 11.1.3Literal Reference63 11.1.4Array Initializer63 11.1.5Object Initializer64 11.1.6The Grouping Operator 66 11.2Left-Hand-Side Expressions 66 11.2.1Property Accessors 67 11.2.2The new Operator 68 11.2.3Function Calls 68 11.2.4Argument Lists 68 11.2.5Function Expressions 69 11.3Postfix Expressions 69 11.3.1Postfix Increment Operator 69 11.3.2Postfix Decrement Operator 69 11.4Unary Operators 70 11.4.1The delete Operator 70 11.4.2The void Operator 70 11.4.3The typeof Operator 71 11.4.4Prefix Increment Operator 71 11.4.5Prefix Decrement Operator 71 11.4.6Unary + Operator . 72 11.4.7Unary - Operator 72 11.4.8Bitwise NOT Operator ( ~ ) 72 11.4.9Logical NOT Operator ( ! ) 72 11.5Multiplicative Operators 72 11.5.1Applying the * Operator 73 11.5.2Applying the / Operator 73 11.5.3Applying the % Operator 74
11.6Additive Operators 74 11.6.1The Addition operator ( + ) 74 11.6.2The Subtraction Operator ( - ) 75 11.6.3Applying the Additive Operators to Numbers 75 11.7Bitwise Shift Operators 75 11.7.1The Left Shift Operator ( << )75 11.7.2The Signed Right Shift Operator ( >> )76 11.7.3The Unsigned Right Shift Operator ( >>> )76 11.8Relational Operators 77 11.8.1The Less-than Operator ( < )77 11.8.2The Greater-than Operator ( > )77 11.8.3The Less-than-or-equal Operator ( <= )78 11.8.4The Greater-than-or-equal Operator ( >= )78 11.8.5The Abstract Relational Comparison Algorithm78 11.8.6The instanceof operator79 11.8.7The in operator79 11.9Equality Operators79 11.9.1The Equals Operator ( == )80 11.9.2The Does-not-equals Operator ( != )80 11.9.3The Abstract Equality Comparison Algorithm 80 11.9.4The Strict Equals Operator ( === )81 11.9.5The Strict Does-not-equal Operator ( !== )81 11.9.6The Strict Equality Comparison Algorithm81 11.10Binary Bitwise Operators82 11.11Binary Logical Operators82 11.12Conditional Operator ( ? : )83 11.13Assignment Operators 84 11.13.1Simple Assignment ( = )84 11.13.2Compound Assignment ( op= )84 11.14Comma Operator ( , )85
12Statements86 12.1Block86 12.2Variable Statement 87 12.2.1Strict Mode Restrictions88 12.3Empty Statement88 12.4Expression Statement88 12.5The if Statement89 12.6Iteration Statements89 12.6.1The do-while Statement89 12.6.2The while Statement90 12.6.3The for Statement90 12.6.4The for-in Statement91 12.7The continue Statement92 12.8The break Statement92 12.9The return Statement92 12.10The with Statement93 12.10.1Strict Mode Restrictions93 12.11The switch Statement93 12.12Labelled Statements95 12.13The throw Statement95 12.14The try Statement96 12.14.1Strict Mode Restrictions97 12.15The debugger statement97
13Function Definition97 13.1Strict Mode Restrictions98 13.2Creating Function Objects99 13.2.1[[Call]]99 13.2.2[[Construct]]100 13.2.3The [[ThrowTypeError]] Function Object100
14Program100 14.1Directive Prologues and the Use Strict Directive101
15Standard Built-in ECMAScript Objects101
15.1The Global Object102 15.1.1Value Properties of the Global Object103 15.1.1.1NaN103 15.1.1.2Infinity103 15.1.1.3undefined103 15.1.2Function Properties of the Global Object103 15.1.2.1eval (x)103 15.1.2.1.1Direct Call to Eval103 15.1.2.2parseInt (string , radix)104 15.1.2.3parseFloat (string)104 15.1.2.4isNaN (number)105 15.1.2.5isFinite (number)105 15.1.3URI Handling Function Properties105 15.1.3.1decodeURI (encodedURI)108 15.1.3.2decodeURIComponent (encodedURIComponent)109 15.1.3.3encodeURI (uri)109 15.1.3.4encodeURIComponent (uriComponent)109 15.1.4Constructor Properties of the Global Object109 15.1.4.1Object ( . . . )109 15.1.4.2Function ( . . . )109 15.1.4.3Array ( . . . )109 15.1.4.4String ( . . . )110 15.1.4.5Boolean ( . . . )110 15.1.4.6Number ( . . . )110 15.1.4.7Date ( . . . )110 15.1.4.8RegExp ( . . . )110 15.1.4.9Error ( . . . )110 15.1.4.10EvalError ( . . . )110 15.1.4.11RangeError ( . . . )110 15.1.4.12ReferenceError ( . . . )110 15.1.4.13SyntaxError ( . . . )110 15.1.4.14TypeError ( . . . )110 15.1.4.15URIError ( . . . )110
15.1.5Other Properties of the Global Object110 15.1.5.1Math110 15.1.5.2JSON111
15.2Object Objects111 15.2.1The Object Constructor Called as a Function111 15.2.1.1Object ( [ value ] )111 15.2.2The Object Constructor111 15.2.2.1new Object ( [ value ] )111 15.2.3Properties of the Object Constructor111 15.2.3.1Object.prototype111 15.2.3.2Object.getPrototypeOf (O)112 15.2.3.3Object.getOwnPropertyDescriptor (O,P)112 15.2.3.4Object.getOwnPropertyNames (O)112 15.2.3.5Object.create (O [, Properties] )112 15.2.3.6Object.defineProperty (O,P,Attributes)112 15.2.3.7Object.defineProperty (O,Properties)113 15.2.3.8Object.seal (O)113 15.2.5.9Object.freeze (O)113 15.2.3.10Object.preventExtensions (O)113 15.2.3.11Object.isSealed (O)113 15.2.3.12Object.isFrozen (O)114 15.2.3.13Object.isExtensible (O)114 15.2.3.14Object.keys (O)114 15.2.4Properties of the Object Prototype Object114 15.2.4.1Object.prototype.constructor114 15.2.4.2Object.prototype.toString ( )114 15.2.4.3Object.prototype.toLocaleString ( )115 15.2.4.4Object.prototype.valueOf ( )115 15.2.4.5 Object.prototype.hasOwnProperty (V)115
15.2.4.6 Object.prototype.isPrototypeOf (V)115 15.2.4.7 Object.prototype.propertyIsEnumerable (V)116
15.2.5Properties of Object Instances116 15.3Function Objects116 15.3.1The Function Constructor Called as a Function116 15.3.1.1Function (p1, p2, … , pn, body)116 15.3.2The Function Constructor116 15.3.2.1new Function (p1, p2, … , pn, body)116 15.3.3Properties of the Function Constructor117 15.3.3.1Function.prototype117 15.3.3.2Function.length117 15.3.4Properties of the Function Prototype Object117 15.3.4.1Function.prototype.constructor118 15.3.4.2Function.prototype.toString ( )118 15.3.4.3Function.prototype.apply (thisArg, argArray)118 15.3.4.4Function.prototype.call (thisArg [ , arg1 [ , arg2, … ] ] )118 15.3.4.5 Function.prototype.bind (thisArg [, arg1 [, arg2, …]])119 15.3.4.5.1[[Call]]119 15.3.4.5.2[[Construct]]119 15.3.4.5.3[[HasInstance]] (V)120 15.3.5Properties of Function Instances120 15.3.5.1length120 15.3.5.2prototype120 15.3.5.3[[HasInstance]] (V)120 15.3.5.4[[Get]] (P)121
15.4Array Objects121 15.4.1The Array Constructor Called as a Function121 15.4.1.1Array ( [ item1 [ , item2 [ , … ] ] ] )121 15.4.2The Array Constructor122 15.4.2.1new Array ( [ item0 [ , item1 [ , … ] ] ] )122 15.4.2.2new Array (len)122 15.4.3Properties of the Array Constructor122 15.4.3.1Array.prototype122 15.4.3.2Array.isArray ( arg )122
15.4.4Properties of the Array Prototype Object123 15.4.4.1Array.prototype.constructor123 15.4.4.2Array.prototype.toString ( )123 15.4.4.3Array.prototype.toLocaleString ( )123 15.4.4.4Array.prototype.concat ( [ item1 [ , item2 [ , … ] ] ] )124 15.4.4.5Array.prototype.join (separator)125 15.4.4.6Array.prototype.pop125 15.4.4.7Array.prototype.push ( [ item1 [ , item2 [ , … ] ] ] )126 15.4.4.8Array.prototype.reverse ()126 15.4.4.9Array.prototype.shift ()127 15.4.4.10Array.prototype.slice (start, end)127 15.4.4.11Array.prototype.sort (comparefn)128 15.4.4.12Array.prototype.splice (start, deleteCount [ , item1 [ , item2 [ , … ] ] ] )130 15.4.4.13Array.prototype.unshift ( [ item1 [ , item2 [ , … ] ] ] )131 15.4.4.14Array.prototype.indexOf ( searchElement [ , fromIndex ] )132 15.4.4.15Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] )132 15.4.4.16Array.prototype.every ( callbackfn [ , thisArg ] )133 15.4.4.17Array.prototype.some ( callbackfn [ , thisArg ] )134 15.4.4.18Array.prototype.forEach ( callbackfn [ , thisArg ] )135 15.4.4.19Array.prototype.map ( callbackfn [ , thisArg ] )135 15.4.4.20Array.prototype.filter ( callbackfn [ , thisArg ] )136 15.4.4.21Array.prototype.reduce ( callbackfn [ , initialValue ] )137 15.4.4.22Array.prototype.reduceRight ( callbackfn [ , initialValue ] )138
15.4.5Properties of Array Instances139 15.4.5.1[[DefineOwnProperty]] ( P, Desc, Throw )139 15.4.5.2length140
15.5String Objects140 15.5.1The String Constructor Called as a Function140 15.5.1.1String ( [ value ] )141 15.5.2The String Constructor141 15.5.2.1new String ( [ value ] )141 15.5.3Properties of the String Constructor141 15.5.3.1String.prototype141 15.5.3.2String.fromCharCode ( [ char0 [ , char1 [ , … ] ] ] )141 15.5.4Properties of the String Prototype Object141 15.5.4.1String.prototype.constructor141 15.5.4.2String.prototype.toString141 15.5.4.3String.prototype.valueOf142 15.5.4.4String.prototype.charAt(pos)142 15.5.4.5String.prototype.charCodeAt(pos)142 15.5.4.6String.prototype.concat142 15.5.4.7String.prototype.indexOf143 15.5.4.8String.prototype.lastIndexOf143 15.5.4.9String.prototype.localeCompare144 15.5.4.10String.prototype.match (regexp)144 15.5.4.11String.prototype.replace145 15.5.4.12String.prototype.search (regexp)146 15.5.4.13String.prototype.slice (start, end)146 15.5.4.14String.prototype.split (separator, limit)147 15.5.4.15String.prototype.substring (start, end)149 15.5.4.16String.prototype.toLowerCase149 15.5.4.17String.prototype.toLocaleLowerCase150 15.5.4.18String.prototype.toUpperCase150 15.5.4.19String.prototype.toLocaleUpperCase150 15.5.4.20String.prototype.trim150 15.5.5Properties of String Instances150 15.5.5.1length151 15.5.5.2[[GetOwnProperty]] ( P )151
15.6Boolean Objects151 15.6.1The Boolean Constructor Called as a Function151 15.6.1.1Boolean (value)151 15.6.2The Boolean Constructor151 15.6.2.1new Boolean (value)151 15.6.3Properties of the Boolean Constructor152 15.6.3.1Boolean Prototype152 15.6.4Properties of the Boolean Prototype Object152 15.6.4.1Boolean.prototype.constructor152 15.6.4.2Boolean.prototype.toString ( )152 15.6.4.3Boolean.prototype.valueOf ( )152 15.6.5Properties of Boolean Instances152
15.7Number Objects153 15.7.1The Number Constructor Called as a Function153 15.7.1.1Number ( [ value ] )153 15.7.2The Number Constructor153 15.7.2.1new Number ( [ value ] )153 15.7.3Properties of the Number Constructor153 15.7.3.1Number.prototype153 15.7.3.2Number.MAX_VALUE153 15.7.3.3Number.MIN_VALUE153 15.7.3.4Number.NaN153 15.7.3.5Number.NEGATIVE_INFINITY153 15.7.3.6Number.POSITIVE_INFINITY153 15.7.4Properties of the Number Prototype Object154 15.7.4.1Number.prototype.constructor154 15.7.4.2Number.prototype.toString ( [ radix ] )154 15.7.4.3Number.prototype.toLocaleString()155 15.7.4.4Number.prototype.valueOf ( )155 15.7.4.5Number.prototype.toFixed (fractionDigits)155 15.7.4.6Number.prototype.toExponential (fractionDigits)156 15.7.4.7Number.prototype.toPrecision (precision)157
15.7.5Properties of Number Instances158
15.8The Math Object158 15.8.1Value Properties of the Math Object158 15.8.1.1E158 15.8.1.2LN10158 15.8.1.3LN2158 15.8.1.4LOG2E158 15.8.1.5LOG10E159 15.8.1.6PI159 15.8.1.7SQRT1_2159 15.8.1.8SQRT2159 15.8.2Function Properties of the Math Object159 15.8.2.1abs (x)159 15.8.2.2acos (x)160 15.8.2.3asin (x)160 15.8.2.4atan (x)160 15.8.2.5atan2 (y, x)160 15.8.2.6ceil (x)161 15.8.2.7cos (x)161 15.8.2.8exp (x)161 15.8.2.9floor (x)161 15.8.2.10log (x)162 15.8.2.11max ( [ value1 [ , value2 [ , … ] ] ] )162 15.8.2.12 min ( [ value1 [ , value2 [ , … ] ] ] )162 15.8.2.13pow (x, y)162 15.8.2.14random ( )163 15.8.2.15round (x)163 15.8.2.16sin (x)163 15.8.2.17sqrt (x)163 15.8.2.18 tan (x)164
15.9Date Objects164 15.9.1Overview of Date Objects and Definitions of Abstract Operators164 15.9.1.1Time Values and Time Range164 15.9.1.2Day Number and Time within Day164 15.9.1.3Year Number164 15.9.1.4Month Number165 15.9.1.5Date Number165 15.9.1.6Week Day164 15.9.1.7Local Time Zone Adjustment166 15.9.1.8Daylight Saving Time Adjustment166 15.9.1.9Local Time166 15.9.1.10Hours, Minutes, Second, and Milliseconds166 15.9.1.11MakeTime (hour, min, sec, ms)167 15.9.1.12MakeDay (year, month, date)167 15.9.1.13MakeDate (day, time)167 15.9.1.14TimeClip (time)167 15.9.1.15Date Time String Format168 15.9.1.15.1Extended years169
15.9.2The Date Constructor Called as a Function169 15.9.2.1Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] )169 15.9.3The Date Constructor (called as a constructor)169 15.9.3.1new Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] )169 15.9.3.2new Date (value)169 15.9.3.3new Date ()170
15.9.4Properties of the Date Constructor170 15.9.4.1Date.prototype170 15.9.4.2Date.parse (string)170 15.9.4.3Date.UTC (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] )171 15.9.4.4Date.now ( )171
15.9.5Properties of the Date Prototype Object171 15.9.5.1Date.prototype.constructor171 15.9.5.2Date.prototype.toString ( )171 15.9.5.3Date.prototype.toDateString ( )172 15.9.5.4Date.prototype.toTimeString ( )172 15.9.5.5Date.prototype.toLocaleString ( )172 15.9.5.6Date.prototype.toLocaleDateString ( )172 15.9.5.7Date.prototype.toLocaleTimeString ( )172 15.9.5.8Date.prototype.valueOf ( )172 15.9.5.9Date.prototype.getTime ( )172 15.9.5.10Date.prototype.getFullYear ( )172 15.9.5.11Date.prototype.getUTCFullYear ( )172 15.9.5.12Date.prototype.getMonth ( )173 15.9.5.13Date.prototype.getUTCMonth ( )173 15.9.5.14Date.prototype.getDate ( )173 15.9.5.15Date.prototype.getUTCDate ( )173 15.9.5.16Date.prototype.getDay ( )173 15.9.5.17Date.prototype.getUTCDay ( )173 15.9.5.18Date.prototype.getHours ( )173 15.9.5.19Date.prototype.getUTCHours ( )173 15.9.5.20Date.prototype.getMinutes ( )173 15.9.5.21Date.prototype.getUTCMinutes ( )174 15.9.5.22Date.prototype.getSeconds ( )174 15.9.5.23Date.prototype.getUTCSeconds ( )174 15.9.5.24Date.prototype.getMilliseconds ( )174 15.9.5.25Date.prototype.getUTCMilliseconds ( )174 15.9.5.26Date.prototype.getTimezoneOffset ( )174 15.9.5.27Date.prototype.setTime (time)174 15.9.5.28Date.prototype.setMilliseconds (ms)174 15.9.5.29Date.prototype.setUTCMilliseconds (ms)174 15.9.5.30Date.prototype.setSeconds175 15.9.5.31Date.prototype.setUTCSeconds175 15.9.5.32Date.prototype.setMinutes175 15.9.5.33Date.prototype.setUTCMinutes175 15.9.5.34Date.prototype.setHours176 15.9.5.35Date.prototype.setUTCHours176 15.9.5.36Date.prototype.setDate (date)176 15.9.5.37Date.prototype.setUTCDate (date)177 15.9.5.38Date.prototype.setMonth (month [, date ] )177 15.9.5.39Date.prototype.setUTCMonth177 15.9.5.40Date.prototype.setFullYear177 15.9.5.41Date.prototype.setUTCFullYear177 15.9.5.42Date.prototype.toUTCString ( )178 15.9.5.43Date.prototype.toISOString ( )178 15.9.5.44Date.prototype.toJSON ( key )178 15.9.6Properties of Date Instances178
15.10RegExp (Regular Expression) Objects179 15.10.1Patterns179 15.10.2Pattern Semantics181 15.10.2.1Notation181 15.10.2.2Pattern182 15.10.2.3Disjunction182 15.10.2.4Alternative183 15.10.2.5Term183 15.10.2.6Assertion185 15.10.2.7Quantifier186 15.10.2.8Atom187 15.10.2.9Atom Escape189
15.10.2.10CharacterEscape189 15.10.2.11DecimalEscape190 15.10.2.12CharacterClassEscape190 15.10.2.13CharacterClass190 15.10.2.14ClassRanges191 15.10.2.15NonemptyClassRanges191 15.10.2.16NonemptyClassRangesNoDash191 15.10.2.17ClassAtom192 15.10.2.18ClassAtomNoDash192 15.10.2.19ClassEscape192 15.10.3The RegExp Constructor Called as a Function193 15.10.3.1RegExp (pattern, flags)193 15.10.4The RegExp Constructor193 15.10.4.1The RegExp Constructor193 15.10.5Properties of the RegExp Constructor194 15.10.5.1RegExp.prototype194 15.10.6Properties of the RegExp Prototype Object194 15.10.6.1RegExp.prototype.constructor194 15.10.6.2RegExp.prototype.exec(string)194 15.10.6.3RegExp.prototype.test(string)195 15.10.6.4RegExp.prototype.toString()195 15.10.7Properties of RegExp Instances195 15.10.7.1source196 15.10.7.2global196 15.10.7.3ignoreCase196 15.10.7.4multiline196 15.10.7.5lastIndex196
15.11Error Objects196 15.11.1The Error Constructor Called as a Function196 15.11.1.1Error (message)196 15.11.2The Error Constructor197 15.11.2.1new Error (message)197 15.11.3Properties of the Error Constructor197 15.11.3.1Error.prototype197 15.11.4Properties of the Error Prototype Object197 15.11.4.1Error.prototype.constructor197 15.11.4.2Error.prototype.name197 15.11.4.3Error.prototype.message197 15.11.4.4Error.prototype.toString ( )197 15.11.5Properties of Error Instances198 15.11.6Native Error Types Used in This Standard198 15.11.6Native Error Types Used in This Standard198 15.11.6.1EvalError198 15.11.6.2RangeError198 15.11.6.3ReferenceError198 15.11.6.4SyntaxError198 15.11.6.5TypeError198 15.11.6.6URIError198 15.11.7NativeError Object Structure199 15.11.7.1NativeError Constructors Called as Functions199 15.11.7.2NativeError (message)199 15.11.7.3NativeError (message)199 15.11.7.4New NativeError (message)199 15.11.7.5Properties of the NativeError Constructors199 15.11.7.6NativeError.prototype199 15.11.7.7Properties of the NativeError Prototype Objects200 15.11.7.8NativeError.prototype.constructor200 15.11.7.9NativeError.prototype.name200 15.11.7.10NativeError.prototype.message200 15.11.7.11Properties of NativeError Instances200
15.12The JSON Object200 15.12.1The JSON Grammar201 15.12.1.1The JSON Lexical Grammar201 15.12.1.2The JSON Syntactic Grammar201 15.12.2parse ( text [ , reviver ] )202 15.12.3stringify ( value [ , replacer [ , space ] ] )203
16Errors207

Annex A (informative)Grammar Summary209 Annex B (informative)Compatibility229 Annex C (informative)The Strict Mode of ECMAScript233 Annex D (informative)Corrections and Clarifications in the 5th Edition with Possible 3rd Edition Compatibility Impact235 Annex E (informative)Additions and Changes in the 5th Edition that Introduce Incompatibilities with the 3rd Edition237