-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjavascript_ecma_262_5th_ed.info-1
More file actions
7275 lines (5484 loc) · 292 KB
/
javascript_ecma_262_5th_ed.info-1
File metadata and controls
7275 lines (5484 loc) · 292 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
これは javascript_ecma_262_5th_ed.info、es5.texi より makeinfo
バージョン 4.8 によって作成されました。
File: javascript_ecma_262_5th_ed.info, Node: Top, Up: (dir)
ECMAScript Language Specification (ECMA-262 5th Edition)
********************************************************
*This is _not_ the official ECMAScript Language Specification.*
The official specification is the PDF document located at
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf
(http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf).
This HTML version was created from the original PDF version by a
preposterous concatenation of hacks. It very likely contains errors and
the official standard and errata are of course definitive. For
copyright information, see ECMA's legal disclaimer (#ecma-disclaimer)
in the document itself.
This version was created by Jason Orendorff and incorporates the
official errata
(http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&cache=cache&media=resources:es5_errata_7-31-10.pdf)
as of 31 July 2010.
Last updated: 5 November 2010.
PDF page 1
* Menu:
* ECMA-262 5th Edition / December 2009 ECMAScript Language Specification::
* Contents::
* Introduction::
* 1 Scope::
* 2 Conformance::
* 3 Normative references::
* 4 Overview::
* 41 Web Scripting::
* 42 Language Overview::
* 421 Objects::
* 422 The Strict Variant of ECMAScript::
* 43 Definitions::
* 431 type::
* 432 primitive value::
* 433 object::
* 434 constructor::
* 435 prototype::
* 436 native object::
* 437 built-in object::
* 438 host object::
* 439 undefined value::
* 4310 Undefined type::
* 4311 null value::
* 4312 Null type::
* 4313 Boolean value::
* 4314 Boolean type::
* 4315 Boolean object::
* 4316 String value::
* 4317 String type::
* 4318 String object::
* 4319 Number value::
* 4320 Number type::
* 4321 Number object::
* 4322 Infinity::
* 4323 NaN::
* 4324 function::
* 4325 built-in function::
* 4326 property::
* 4327 method::
* 4328 built-in method::
* 4329 attribute::
* 4330 own property::
* 4331 inherited property::
* 5 Notational Conventions::
* 51 Syntactic and Lexical Grammars::
* 511 Context-Free Grammars::
* 512 The Lexical and RegExp Grammars::
* 513 The Numeric String Grammar::
* 514 The Syntactic Grammar::
* 515 The JSON Grammar::
* 516 Grammar Notation::
* 52 Algorithm Conventions::
* 6 Source Text::
* 7 Lexical Conventions::
* 71 Unicode Format-Control Characters::
* 72 White Space::
* 73 Line Terminators::
* 74 Comments::
* 75 Tokens::
* 76 Identifier Names and Identifiers::
* 761 Reserved Words::
* 7611 Keywords::
* 7612 Future Reserved Words::
* 77 Punctuators::
* 78 Literals::
* 781 Null Literals::
* 782 Boolean Literals::
* 783 Numeric Literals::
* 784 String Literals::
* 785 Regular Expression Literals::
* 79 Automatic Semicolon Insertion::
* 791 Rules of Automatic Semicolon Insertion::
* 792 Examples of Automatic Semicolon Insertion::
* 8 Types::
* 81 The Undefined Type::
* 82 The Null Type::
* 83 The Boolean Type::
* 84 The String Type::
* 85 The Number Type::
* 86 The Object Type::
* 861 Property Attributes::
* 862 Object Internal Properties and Methods::
* 87 The Reference Specification Type::
* 871 GetValue V::
* 872 PutValue V W::
* 88 The List Specification Type::
* 89 The Completion Specification Type::
* 810 The Property Descriptor and Property Identifier Specification Types::
* 8101 IsAccessorDescriptor Desc ::
* 8102 IsDataDescriptor Desc ::
* 8103 IsGenericDescriptor Desc ::
* 8104 FromPropertyDescriptor Desc ::
* 8105 ToPropertyDescriptor Obj ::
* 811 The Lexical Environment and Environment Record Specification Types::
* 812 Algorithms for Object Internal Methods::
* 8121 [[GetOwnProperty]] P::
* 8122 [[GetProperty]] P::
* 8123 [[Get]] P::
* 8124 [[CanPut]] P::
* 8125 [[Put]] P V Throw ::
* 8126 [[HasProperty]] P::
* 8127 [[Delete]] P Throw::
* 8128 [[DefaultValue]] hint::
* 8129 [[DefineOwnProperty]] P Desc Throw::
* 9 Type Conversion and Testing::
* 91 ToPrimitive::
* 92 ToBoolean::
* 93 ToNumber::
* 931 ToNumber Applied to the String Type::
* 94 ToInteger::
* 95 ToInt32 Signed 32 Bit Integer::
* 96 ToUint32 Unsigned 32 Bit Integer::
* 97 ToUint16 Unsigned 16 Bit Integer::
* 98 ToString::
* 981 ToString Applied to the Number Type::
* 99 ToObject::
* 910 CheckObjectCoercible::
* 911 IsCallable::
* 912 The SameValue Algorithm::
* 10 Executable Code and Execution Contexts::
* 101 Types of Executable Code::
* 1011 Strict Mode Code::
* 102 Lexical Environments::
* 1021 Environment Records::
* 10211 Declarative Environment Records::
* 102111 HasBindingN::
* 102112 CreateMutableBinding N D::
* 102113 SetMutableBindingNVS::
* 102114 GetBindingValueNS::
* 102115 DeleteBinding N::
* 102116 ImplicitThisValue::
* 102117 CreateImmutableBinding N::
* 102118 InitializeImmutableBinding NV::
* 10212 Object Environment Records::
* 102121 HasBindingN::
* 102122 CreateMutableBinding N D::
* 102123 SetMutableBinding NVS::
* 102124 GetBindingValueNS::
* 102125 DeleteBindingN::
* 102126 ImplicitThisValue::
* 1022 Lexical Environment Operations::
* 10221 GetIdentifierReference lex name strict::
* 10222 NewDeclarativeEnvironmentE::
* 10223 NewObjectEnvironment O E::
* 1023 The Global Environment::
* 103 Execution Contexts::
* 1031 Identifier Resolution::
* 104 Establishing an Execution Context::
* 1041 Entering Global Code::
* 10411 Initial Global Execution Context::
* 1042 Entering Eval Code::
* 10421 Strict Mode Restrictions::
* 1043 Entering Function Code::
* 105 Declaration Binding Instantiation::
* 106 Arguments Object::
* 11 Expressions::
* 111 Primary Expressions::
* 1111 The this Keyword::
* 1112 Identifier Reference::
* 1113 Literal Reference::
* 1114 Array Initialiser::
* 1115 Object Initialiser::
* 1116 The Grouping Operator::
* 112 Left-Hand-Side Expressions::
* 1121 Property Accessors::
* 1122 The new Operator::
* 1123 Function Calls::
* 1124 Argument Lists::
* 1125 Function Expressions::
* 113 Postfix Expressions::
* 1131 Postfix Increment Operator::
* 1132 Postfix Decrement Operator::
* 114 Unary Operators::
* 1141 The delete Operator::
* 1142 The void Operator::
* 1143 The typeof Operator::
* 1144 Prefix Increment Operator::
* 1145 Prefix Decrement Operator::
* 1146 Unary + Operator::
* 1147 Unary - Operator::
* 1148 Bitwise NOT Operator ~ ::
* 1149 Logical NOT Operator ! ::
* 115 Multiplicative Operators::
* 1151 Applying the * Operator::
* 1152 Applying the / Operator::
* 1153 Applying the % Operator::
* 116 Additive Operators::
* 1161 The Addition operator + ::
* 1162 The Subtraction Operator - ::
* 1163 Applying the Additive Operators to Numbers::
* 117 Bitwise Shift Operators::
* 1171 The Left Shift Operator << ::
* 1172 The Signed Right Shift Operator >> ::
* 1173 The Unsigned Right Shift Operator >>> ::
* 118 Relational Operators::
* 1181 The Less-than Operator < ::
* 1182 The Greater-than Operator > ::
* 1183 The Less-than-or-equal Operator <= ::
* 1184 The Greater-than-or-equal Operator >= ::
* 1185 The Abstract Relational Comparison Algorithm::
* 1186 The instanceof operator::
* 1187 The in operator::
* 119 Equality Operators::
* 1191 The Equals Operator == ::
* 1192 The Does-not-equals Operator != ::
* 1193 The Abstract Equality Comparison Algorithm::
* 1194 The Strict Equals Operator === ::
* 1195 The Strict Does-not-equal Operator !== ::
* 1196 The Strict Equality Comparison Algorithm::
* 1110 Binary Bitwise Operators::
* 1111 Binary Logical Operators::
* 1112 Conditional Operator ? ::
* 1113 Assignment Operators::
* 11131 Simple Assignment = ::
* 11132 Compound Assignment <var>op</var>= ::
* 1114 Comma Operator ::
* 12 Statements::
* 121 Block::
* 122 Variable Statement::
* 1221 Strict Mode Restrictions::
* 123 Empty Statement::
* 124 Expression Statement::
* 125 The if Statement::
* 126 Iteration Statements::
* 1261 The do–while Statement::
* 1262 The while Statement::
* 1263 The for Statement::
* 1264 The for–in Statement::
* 127 The continue Statement::
* 128 The break Statement::
* 129 The return Statement::
* 1210 The with Statement::
* 12101 Strict Mode Restrictions::
* 1211 The switch Statement::
* 1212 Labelled Statements::
* 1213 The throw Statement::
* 1214 The try Statement::
* 12141 Strict Mode Restrictions::
* 1215 The debugger statement::
* 13 Function Definition::
* 131 Strict Mode Restrictions::
* 132 Creating Function Objects::
* 1321 [[Call]]::
* 1322 [[Construct]]::
* 1323 The [[ThrowTypeError]] Function Object::
* 14 Program::
* 141 Directive Prologues and the Use Strict Directive::
* 15 Standard Built-in ECMAScript Objects::
* 151 The Global Object::
* 1511 Value Properties of the Global Object::
* 15111 NaN::
* 15112 Infinity::
* 15113 undefined::
* 1512 Function Properties of the Global Object::
* 15121 eval x::
* 151211 Direct Call to Eval::
* 15122 parseInt string radix::
* 15123 parseFloatstring::
* 15124 isNaN number::
* 15125 isFinitenumber::
* 1513 URI Handling Function Properties::
* 15131 decodeURI encodedURI::
* 15132 decodeURIComponent encodedURIComponent::
* 15133 encodeURI uri::
* 15134 encodeURIComponent uriComponent::
* 1514 Constructor Properties of the Global Object::
* 15141 Object ::
* 15142 Function ::
* 15143 Array ::
* 15144 String ::
* 15145 Boolean ::
* 15146 Number ::
* 15147 Date ::
* 15148 RegExp ::
* 15149 Error ::
* 151410 EvalError ::
* 151411 RangeError ::
* 151412 ReferenceError ::
* 151413 SyntaxError ::
* 151414 TypeError ::
* 151415 URIError ::
* 1515 Other Properties of the Global Object::
* 15151 Math::
* 15152 JSON::
* 152 Object Objects::
* 1521 The Object Constructor Called as a Function::
* 15211 Object [ value ] ::
* 1522 The Object Constructor::
* 15221 new Object [ value ] ::
* 1523 Properties of the Object Constructor::
* 15231 Objectprototype::
* 15232 ObjectgetPrototypeOf O ::
* 15233 ObjectgetOwnPropertyDescriptor O P ::
* 15234 ObjectgetOwnPropertyNames O ::
* 15235 Objectcreate O [ Properties] ::
* 15236 ObjectdefineProperty O P Attributes ::
* 15237 ObjectdefineProperties O Properties ::
* 15238 Objectseal O ::
* 15239 Objectfreeze O ::
* 152310 ObjectpreventExtensions O ::
* 152311 ObjectisSealed O ::
* 152312 ObjectisFrozen O ::
* 152313 ObjectisExtensible O ::
* 152314 Objectkeys O ::
* 1524 Properties of the Object Prototype Object::
* 15241 Objectprototypeconstructor::
* 15242 ObjectprototypetoString ::
* 15243 ObjectprototypetoLocaleString ::
* 15244 ObjectprototypevalueOf ::
* 15245 ObjectprototypehasOwnProperty V::
* 15246 ObjectprototypeisPrototypeOf V::
* 15247 ObjectprototypepropertyIsEnumerable V::
* 1525 Properties of Object Instances::
* 153 Function Objects::
* 1531 The Function Constructor Called as a Function::
* 15311 Function p1 p2 pn body::
* 1532 The Function Constructor::
* 15321 new Function p1 p2 pn body::
* 1533 Properties of the Function Constructor::
* 15331 Functionprototype::
* 15332 Functionlength::
* 1534 Properties of the Function Prototype Object::
* 15341 Functionprototypeconstructor::
* 15342 FunctionprototypetoString ::
* 15343 Functionprototypeapply thisArg argArray::
* 15344 Functionprototypecall thisArg [ arg1 [ arg2 ] ] ::
* 15345 Functionprototypebind thisArg [ arg1 [ arg2 ]]::
* 153451 [[Call]]::
* 153452 [[Construct]]::
* 153453 [[HasInstance]] V::
* 1535 Properties of Function Instances::
* 15351 length::
* 15352 prototype::
* 15353 [[HasInstance]] V::
* 15354 [[Get]] P::
* 154 Array Objects::
* 1541 The Array Constructor Called as a Function::
* 15411 Array [ item1 [ item2 [ ] ] ] ::
* 1542 The Array Constructor::
* 15421 new Array [ item0 [ item1 [ ] ] ] ::
* 15422 new Array len::
* 1543 Properties of the Array Constructor::
* 15431 Arrayprototype::
* 15432 ArrayisArray arg ::
* 1544 Properties of the Array Prototype Object::
* 15441 Arrayprototypeconstructor::
* 15442 ArrayprototypetoString ::
* 15443 ArrayprototypetoLocaleString ::
* 15444 Arrayprototypeconcat [ item1 [ item2 [ ] ] ] ::
* 15445 Arrayprototypejoin separator::
* 15446 Arrayprototypepop ::
* 15447 Arrayprototypepush [ item1 [ item2 [ ] ] ] ::
* 15448 Arrayprototypereverse ::
* 15449 Arrayprototypeshift ::
* 154410 Arrayprototypeslice start end::
* 154411 Arrayprototypesort comparefn::
* 154412 Arrayprototypesplice start deleteCount [ item1 [ item2 [ ] ] ] ::
* 154413 Arrayprototypeunshift [ item1 [ item2 [ ] ] ] ::
* 154414 ArrayprototypeindexOf searchElement [ fromIndex ] ::
* 154415 ArrayprototypelastIndexOf searchElement [ fromIndex ] ::
* 154416 Arrayprototypeevery callbackfn [ thisArg ] ::
* 154417 Arrayprototypesome callbackfn [ thisArg ] ::
* 154418 ArrayprototypeforEach callbackfn [ thisArg ] ::
* 154419 Arrayprototypemap callbackfn [ thisArg ] ::
* 154420 Arrayprototypefilter callbackfn [ thisArg ] ::
* 154421 Arrayprototypereduce callbackfn [ initialValue ] ::
* 154422 ArrayprototypereduceRight callbackfn [ initialValue ] ::
* 1545 Properties of Array Instances::
* 15451 [[DefineOwnProperty]] P Desc Throw ::
* 15452 length::
* 155 String Objects::
* 1551 The String Constructor Called as a Function::
* 15511 String [ value ] ::
* 1552 The String Constructor::
* 15521 new String [ value ] ::
* 1553 Properties of the String Constructor::
* 15531 Stringprototype::
* 15532 StringfromCharCode [ char0 [ char1 [ ] ] ] ::
* 1554 Properties of the String Prototype Object::
* 15541 Stringprototypeconstructor::
* 15542 StringprototypetoString ::
* 15543 StringprototypevalueOf ::
* 15544 StringprototypecharAt pos::
* 15545 StringprototypecharCodeAt pos::
* 15546 Stringprototypeconcat [ string1 [ string2 [ ] ] ] ::
* 15547 StringprototypeindexOf searchString position::
* 15548 StringprototypelastIndexOf searchString position::
* 15549 StringprototypelocaleCompare that::
* 155410 Stringprototypematch regexp::
* 155411 Stringprototypereplace searchValue replaceValue::
* 155412 Stringprototypesearch regexp::
* 155413 Stringprototypeslice start end::
* 155414 Stringprototypesplit separator limit::
* 155415 Stringprototypesubstring start end::
* 155416 StringprototypetoLowerCase ::
* 155417 StringprototypetoLocaleLowerCase ::
* 155418 StringprototypetoUpperCase ::
* 155419 StringprototypetoLocaleUpperCase ::
* 155420 Stringprototypetrim ::
* 1555 Properties of String Instances::
* 15551 length::
* 15552 [[GetOwnProperty]] P ::
* 156 Boolean Objects::
* 1561 The Boolean Constructor Called as a Function::
* 15611 Boolean value::
* 1562 The Boolean Constructor::
* 15621 new Boolean value::
* 1563 Properties of the Boolean Constructor::
* 15631 Booleanprototype::
* 1564 Properties of the Boolean Prototype Object::
* 15641 Booleanprototypeconstructor::
* 15642 BooleanprototypetoString ::
* 15643 BooleanprototypevalueOf ::
* 1565 Properties of Boolean Instances::
* 157 Number Objects::
* 1571 The Number Constructor Called as a Function::
* 15711 Number [ value ] ::
* 1572 The Number Constructor::
* 15721 new Number [ value ] ::
* 1573 Properties of the Number Constructor::
* 15731 Numberprototype::
* 15732 NumberMAX_VALUE::
* 15733 NumberMIN_VALUE::
* 15734 NumberNaN::
* 15735 NumberNEGATIVE_INFINITY::
* 15736 NumberPOSITIVE_INFINITY::
* 1574 Properties of the Number Prototype Object::
* 15741 Numberprototypeconstructor::
* 15742 NumberprototypetoString [ radix ] ::
* 15743 NumberprototypetoLocaleString::
* 15744 NumberprototypevalueOf ::
* 15745 NumberprototypetoFixed fractionDigits::
* 15746 NumberprototypetoExponential fractionDigits::
* 15747 NumberprototypetoPrecision precision::
* 1575 Properties of Number Instances::
* 158 The Math Object::
* 1581 Value Properties of the Math Object::
* 15811 E::
* 15812 LN10::
* 15813 LN2::
* 15814 LOG2E::
* 15815 LOG10E::
* 15816 PI::
* 15817 SQRT1_2::
* 15818 SQRT2::
* 1582 Function Properties of the Math Object::
* 15821 abs x::
* 15822 acos x::
* 15823 asin x::
* 15824 atan x::
* 15825 atan2 y x::
* 15826 ceil x::
* 15827 cosx::
* 15828 expx::
* 15829 floor x::
* 158210 log x::
* 158211 max [ value1 [ value2 [ ] ] ] ::
* 158212 min [ value1 [ value2 [ ] ] ] ::
* 158213 pow x y::
* 158214 random ::
* 158215 round x::
* 158216 sin x::
* 158217 sqrt x::
* 158218 tan x::
* 159 Date Objects::
* 1591 Overview of Date Objects and Definitions of Abstract Operators::
* 15911 Time Values and Time Range::
* 15912 Day Number and Time within Day::
* 15913 Year Number::
* 15914 Month Number::
* 15915 Date Number::
* 15916 Week Day::
* 15917 Local Time Zone Adjustment::
* 15918 Daylight Saving Time Adjustment::
* 15919 Local Time::
* 159110 Hours Minutes Second and Milliseconds::
* 159111 MakeTime hour min sec ms::
* 159112 MakeDay year month date::
* 159113 MakeDate day time::
* 159114 TimeClip time::
* 159115 Date Time String Format::
* 1591151 Extended years::
* 1592 The Date Constructor Called as a Function::
* 15921 Date [ year [ month [ date [ hours [ minutes [ seconds [ ms ] ] ] ] ] ] ] ::
* 1593 The Date Constructor::
* 15931 new Date year month [ date [ hours [ minutes [ seconds [ ms ] ] ] ] ] ::
* 15932 new Date value::
* 15933 new Date ::
* 1594 Properties of the Date Constructor::
* 15941 Dateprototype::
* 15942 Dateparse string::
* 15943 DateUTC year month [ date [ hours [ minutes [ seconds [ ms ] ] ] ] ] ::
* 15944 Datenow ::
* 1595 Properties of the Date Prototype Object::
* 15951 Dateprototypeconstructor::
* 15952 DateprototypetoString ::
* 15953 DateprototypetoDateString ::
* 15954 DateprototypetoTimeString ::
* 15955 DateprototypetoLocaleString ::
* 15956 DateprototypetoLocaleDateString ::
* 15957 DateprototypetoLocaleTimeString ::
* 15958 DateprototypevalueOf ::
* 15959 DateprototypegetTime ::
* 159510 DateprototypegetFullYear ::
* 159511 DateprototypegetUTCFullYear ::
* 159512 DateprototypegetMonth ::
* 159513 DateprototypegetUTCMonth ::
* 159514 DateprototypegetDate ::
* 159515 DateprototypegetUTCDate ::
* 159516 DateprototypegetDay ::
* 159517 DateprototypegetUTCDay ::
* 159518 DateprototypegetHours ::
* 159519 DateprototypegetUTCHours ::
* 159520 DateprototypegetMinutes ::
* 159521 DateprototypegetUTCMinutes ::
* 159522 DateprototypegetSeconds ::
* 159523 DateprototypegetUTCSeconds ::
* 159524 DateprototypegetMilliseconds ::
* 159525 DateprototypegetUTCMilliseconds ::
* 159526 DateprototypegetTimezoneOffset ::
* 159527 DateprototypesetTime time::
* 159528 DateprototypesetMilliseconds ms::
* 159529 DateprototypesetUTCMilliseconds ms::
* 159530 DateprototypesetSeconds sec [ ms ] ::
* 159531 DateprototypesetUTCSeconds sec [ ms ] ::
* 159532 DateprototypesetMinutes min [ sec [ ms ] ] ::
* 159533 DateprototypesetUTCMinutes min [ sec [ ms ] ] ::
* 159534 DateprototypesetHours hour [ min [ sec [ ms ] ] ] ::
* 159535 DateprototypesetUTCHours hour [ min [ sec [ ms ] ] ] ::
* 159536 DateprototypesetDate date::
* 159537 DateprototypesetUTCDate date::
* 159538 DateprototypesetMonth month [ date ] ::
* 159539 DateprototypesetUTCMonth month [ date ] ::
* 159540 DateprototypesetFullYear year [ month [ date ] ] ::
* 159541 DateprototypesetUTCFullYear year [ month [ date ] ] ::
* 159542 DateprototypetoUTCString ::
* 159543 DateprototypetoISOString ::
* 159544 DateprototypetoJSON key ::
* 1596 Properties of Date Instances::
* 1510 RegExp Regular Expression Objects::
* 15101 Patterns::
* 15102 Pattern Semantics::
* 151021 Notation::
* 151022 Pattern::
* 151023 Disjunction::
* 151024 Alternative::
* 151025 Term::
* 151026 Assertion::
* 151027 Quantifier::
* 151028 Atom::
* 151029 AtomEscape::
* 1510210 CharacterEscape::
* 1510211 DecimalEscape::
* 1510212 CharacterClassEscape::
* 1510213 CharacterClass::
* 1510214 ClassRanges::
* 1510215 NonemptyClassRanges::
* 1510216 NonemptyClassRangesNoDash::
* 1510217 ClassAtom::
* 1510218 ClassAtomNoDash::
* 1510219 ClassEscape::
* 15103 The RegExp Constructor Called as a Function::
* 151031 RegExppattern flags::
* 15104 The RegExp Constructor::
* 151041 new RegExppattern flags::
* 15105 Properties of the RegExp Constructor::
* 151051 RegExpprototype::
* 15106 Properties of the RegExp Prototype Object::
* 151061 RegExpprototypeconstructor::
* 151062 RegExpprototypeexecstring::
* 151063 RegExpprototypeteststring::
* 151064 RegExpprototypetoString::
* 15107 Properties of RegExp Instances::
* 151071 source::
* 151072 global::
* 151073 ignoreCase::
* 151074 multiline::
* 151075 lastIndex::
* 1511 Error Objects::
* 15111 The Error Constructor Called as a Function::
* 151111 Error message::
* 15112 The Error Constructor::
* 151121 new Error message::
* 15113 Properties of the Error Constructor::
* 151131 Errorprototype::
* 15114 Properties of the Error Prototype Object::
* 151141 Errorprototypeconstructor::
* 151142 Errorprototypename::
* 151143 Errorprototypemessage::
* 151144 ErrorprototypetoString ::
* 15115 Properties of Error Instances::
* 15116 Native Error Types Used in This Standard::
* 151161 EvalError::
* 151162 RangeError::
* 151163 ReferenceError::
* 151164 SyntaxError::
* 151165 TypeError::
* 151166 URIError::
* 15117 NativeError Object Structure::
* 151171 NativeError Constructors Called as Functions::
* 151172 NativeError message::
* 151173 The NativeError Constructors::
* 151174 New NativeError message::
* 151175 Properties of the NativeError Constructors::
* 151176 NativeErrorprototype::
* 151177 Properties of the NativeError Prototype Objects::
* 151178 NativeErrorprototypeconstructor::
* 151179 NativeErrorprototypename::
* 1511710 NativeErrorprototypemessage::
* 1511711 Properties of NativeError Instances::
* 1512 The JSON Object::
* 15121 The JSON Grammar::
* 151211 The JSON Lexical Grammar::
* 151212 The JSON Syntactic Grammar::
* 15122 parse text [ reviver ] ::
* 15123 stringify value [ replacer [ space ] ] ::
* 16 Errors::
* Annex A informative Grammar Summary::
* A1 Lexical Grammar::
* A2 Number Conversions::
* A3 Expressions::
* A4 Statements::
* A5 Functions and Programs::
* A6 Universal Resource Identifier Character Classes::
* A7 Regular Expressions::
* A8 JSON::
* A81 JSON Lexical Grammar::
* A82 JSON Syntactic Grammar::
* Annex B informative Compatibility::
* B1 Additional Syntax::
* B11 Numeric Literals::
* B12 String Literals::
* B2 Additional Properties::
* B21 escape string::
* B22 unescape string::
* B23 Stringprototypesubstr start length::
* B24 DateprototypegetYear ::
* B25 DateprototypesetYear year::
* B26 DateprototypetoGMTString ::
* Annex C informative The Strict Mode of ECMAScript::
* Annex D informative Corrections and Clarifications in the 5th Edition with Possible 3rd Edition Compatibility Impact::
* Annex E informative Additions and Changes in the 5th Edition that Introduce Incompatibilities with the 3rd Edition::
* Bibliography::
File: javascript_ecma_262_5th_ed.info, Node: ECMA-262 5th Edition / December 2009 ECMAScript Language Specification, Next: Contents, Prev: Top, Up: Top
1 ECMA-262 5th Edition / December 2009 ECMAScript Language Specification
************************************************************************
Reference number ECMA-123:2009
COPYRIGHT PROTECTED DOCUMENT © Ecma International 2009
File: javascript_ecma_262_5th_ed.info, Node: Contents, Next: Introduction, Prev: ECMA-262 5th Edition / December 2009 ECMAScript Language Specification, Up: Top
2 Contents
**********
1. Introduction (#introduction)
2. 1 Scope (#sec-1)
3. 2 Conformance (#sec-2)
4. 3 Normative references (#sec-3)
5. 4 Overview (#sec-4)
6. 5 Notational Conventions (#sec-5)
7. 6 Source Text (#sec-6)
8. 7 Lexical Conventions (#sec-7)
9. 8 Types (#sec-8)
10. 9 Type Conversion and Testing (#sec-9)
11. 10 Executable Code and Execution Contexts (#sec-10)
12. 11 Expressions (#sec-11)
13. 12 Statements (#sec-12)
14. 13 Function Definition (#sec-13)
15. 14 Program (#sec-14)
16. 15 Standard Built-in ECMAScript Objects (#sec-15)
17. 16 Errors (#sec-16)
18. Annex A (informative) Grammar Summary (#sec-A)
19. Annex B (informative) Compatibility (#sec-B)
20. Annex C (informative) The Strict Mode of ECMAScript (#sec-C)
21. Annex D (informative) Corrections and Clarifications in the 5th
Edition with Possible 3rd Edition Compatibility Impact (#sec-D)
22. Annex E (informative) Additions and Changes in the 5th Edition
that Introduce Incompatibilities with the 3rd Edition (#sec-E)
23. Bibliography (#bibliography)
File: javascript_ecma_262_5th_ed.info, Node: Introduction, Next: 1 Scope, Prev: Contents, Up: Top
3 Introduction
**************
This Ecma Standard is based on several originating technologies, the
most well known being JavaScript (Netscape) and JScript (Microsoft).
The language was invented by Brendan Eich at Netscape and first
appeared in that company’s Navigator 2.0 browser. It has appeared in
all subsequent browsers from Netscape and in all browsers from
Microsoft starting with Internet Explorer 3.0.
The development of this Standard started in November 1996. The first
edition of this Ecma Standard was adopted by the Ecma General Assembly
of June 1997.
That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under
the fast-track procedure, and approved as international standard
ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998
approved the second edition of ECMA-262 to keep it fully aligned with
ISO/IEC 16262. Changes between the first and the second edition are
editorial in nature.
The third edition of the Standard introduced powerful regular
expressions, better string handling, new control statements, try/catch
exception handling, tighter definition of errors, formatting for
numeric output and minor changes in anticipation of forthcoming
internationalisation facilities and future language growth. The third
edition of the ECMAScript standard was adopted by the Ecma General
Assembly of December 1999 and published as ISO/IEC 16262:2002 in June
2002.
Since publication of the third edition, ECMAScript has achieved
massive adoption in conjunction with the World Wide Web where it has
become the programming language that is supported by essentially all
web browsers. Significant work was done to develop a fourth edition of
ECMAScript. Although that work was not completed and not published[1
(#footnote1)] as the fourth edition of ECMAScript, it informs
continuing evolution of the language. The present fifth edition of
ECMAScript (published as ECMA-262 5th edition) codifies de facto
interpretations of the language specification that have become common
among browser implementations and adds support for new features that
have emerged since the publication of the third edition. Such features
include accessor properties, reflective creation and inspection of
objects, program control of property attributes, additional array
manipulation functions, support for the JSON (#sec-15.12) object
encoding format, and a strict mode that provides enhanced error
checking and program security.
ECMAScript is a vibrant language and the evolution of the language
is not complete. Significant technical enhancement will continue with
future editions of this specification.
This Ecma Standard has been adopted by the General Assembly of
December 2009.
[1]Note: Please note that for ECMAScript Edition 4 the Ecma standard
number “ECMA-262 Edition 4” was reserved but not used in the Ecma
publication process. Therefore “ECMA-262 Edition 4” as an Ecma
International publication does not exist.
"DISCLAIMER
This document and possible translations of it may be copied and
furnished to others, and derivative works that comment on or otherwise
explain it or assist in its implementation may be prepared, copied,
published, and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this section are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, including by removing
the copyright notice or references to Ecma International, except as
needed for the purpose of developing any document or deliverable
produced by Ecma International (in which case the rules applied to
copyrights must be followed) or as required to translate it into
languages other than English.
The limited permissions granted above are perpetual and will not be
revoked by Ecma International or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and ECMA INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE."
File: javascript_ecma_262_5th_ed.info, Node: 1 Scope, Next: 2 Conformance, Prev: Introduction, Up: Top
4 1 (#sec-1) Scope
******************
This Standard defines the ECMAScript scripting language.
File: javascript_ecma_262_5th_ed.info, Node: 2 Conformance, Next: 3 Normative references, Prev: 1 Scope, Up: Top
5 2 (#sec-2) Conformance
************************
A conforming implementation of ECMAScript must provide and support all
the types, values, objects, properties, functions, and program syntax
and semantics described in this specification.
A conforming implementation of this International standard shall
interpret characters in conformance with the Unicode Standard, Version
3.0 or later and ISO/IEC 10646-1 with either UCS-2 or UTF-16 as the
adopted encoding form, implementation level 3. If the adopted ISO/IEC
10646-1 subset is not otherwise specified, it is presumed to be the BMP
subset, collection 300. If the adopted encoding form is not otherwise
specified, it presumed to be the UTF-16 encoding form.
A conforming implementation of ECMAScript is permitted to provide
additional types, values, objects, properties, and functions beyond
those described in this specification. In particular, a conforming
implementation of ECMAScript is permitted to provide properties not
described in this specification, and values for those properties, for
objects that are described in this specification.
A conforming implementation of ECMAScript is permitted to support
program and regular expression syntax not described in this
specification. In particular, a conforming implementation of ECMAScript
is permitted to support program syntax that makes use of the “future
reserved words” listed in 7.6.1.2 (#sec-7.6.1.2) of this
specification.
File: javascript_ecma_262_5th_ed.info, Node: 3 Normative references, Next: 4 Overview, Prev: 2 Conformance, Up: Top
6 3 (#sec-3) Normative references
*********************************
The following referenced documents are indispensable for the
application of this document. For dated references, only the edition
cited applies. For undated references, the latest edition of the
referenced document (including any amendments) applies.
ISO/IEC 9899:1996, Programming Languages – C, including amendment
1 and technical corrigenda 1 and 2
ISO/IEC 10646-1:1993, Information Technology – Universal
Multiple-Octet Coded Character Set (UCS) plus its amendments and
corrigenda
File: javascript_ecma_262_5th_ed.info, Node: 4 Overview, Next: 41 Web Scripting, Prev: 3 Normative references, Up: Top
7 4 (#sec-4) Overview
*********************
This section contains a non-normative overview of the ECMAScript
language.
ECMAScript is an object-oriented programming language for performing
computations and manipulating computational objects within a host
environment. ECMAScript as defined here is not intended to be
computationally self-sufficient; indeed, there are no provisions in
this specification for input of external data or output of computed
results. Instead, it is expected that the computational environment of
an ECMAScript program will provide not only the objects and other
facilities described in this specification but also certain
environment-specific host objects, whose description and behaviour are
beyond the scope of this specification except to indicate that they may
provide certain properties that can be accessed and certain functions
that can be called from an ECMAScript program.
ECMAScript was originally designed to be a _Web scripting language_,
providing a mechanism to enliven Web pages in browsers and to perform
server computation as part of a Web-based client-server architecture.
ECMAScript can provide core scripting capabilities for a variety of
host environments, and therefore the core scripting language is
specified in this document apart from any particular host environment.
Some of the facilities of ECMAScript are similar to those used in
other programming languages; in particular Java™, Self, and Scheme as
described in:
Gosling, James, Bill Joy and Guy Steele. The Java™ Language
Specification. Addison Wesley Publishing Co., 1996.
Ungar, David, and Smith, Randall B. Self: The Power of Simplicity.
OOPSLA ’87 Conference Proceedings, pp. 227-241, Orlando, FL, October
1987.
IEEE Standard for the Scheme Programming Language. IEEE Std
1178-1990.
File: javascript_ecma_262_5th_ed.info, Node: 41 Web Scripting, Next: 42 Language Overview, Prev: 4 Overview, Up: Top
8 4.1 (#sec-4.1) Web Scripting
******************************
A web browser provides an ECMAScript host environment for client-side
computation including, for instance, objects that represent windows,
menus, pop-ups, dialog boxes, text areas, anchors, frames, history,
cookies, and input/output. Further, the host environment provides a
means to attach scripting code to events such as change of focus, page
and image loading, unloading, error and abort, selection, form
submission, and mouse actions. Scripting code appears within the HTML
and the displayed page is a combination of user interface elements and
fixed and computed text and images. The scripting code is reactive to
user interaction and there is no need for a main program.
A web server provides a different host environment for server-side
computation including objects representing requests, clients, and
files; and mechanisms to lock and share data. By using browser-side and
server-side scripting together, it is possible to distribute
computation between the client and server while providing a customised
user interface for a Web-based application.
Each Web browser and server that supports ECMAScript supplies its
own host environment, completing the ECMAScript execution environment.
File: javascript_ecma_262_5th_ed.info, Node: 42 Language Overview, Next: 421 Objects, Prev: 41 Web Scripting, Up: Top
9 4.2 (#sec-4.2) Language Overview
**********************************
The following is an informal overview of ECMAScript—not all parts of
the language are described. This overview is not part of the standard
proper.
ECMAScript is object-based: basic language and host facilities are
provided by objects, and an ECMAScript program is a cluster of
communicating objects. An ECMAScript _object_ is a collection of
_properties_ each with zero or more _attributes_ that determine how
each property can be used—for example, when the Writable attribute
for a property is set to false, any attempt by executed ECMAScript code
to change the value of the property fails. Properties are containers
that hold other objects, _primitive values_, or _functions_. A
primitive value is a member of one of the following built-in types:
*Undefined*, *Null*, *Boolean*, *Number*, and *String*; an object is a
member of the remaining built-in type *Object*; and a function is a
callable object. A function that is associated with an object via a
property is a _method_.
ECMAScript defines a collection of _built-in objects_ that round out
the definition of ECMAScript entities. These built-in objects include
the global (#sec-15.1) object, the Object (#sec-15.2) object, the
Function (#sec-15.3) object, the Array (#sec-15.4) object, the String
(#sec-15.5) object, the Boolean (#sec-15.6) object, the Number
(#sec-15.7) object, the Math (#sec-15.8) object, the Date (#sec-15.9)
object, the RegExp (#sec-15.10) object, the
ECMAScript also defines a set of built-in _operators_. ECMAScript
operators include various unary operations, multiplicative operators,
additive operators, bitwise shift operators, relational operators,
equality operators, binary bitwise operators, binary logical operators,
assignment operators, and the comma operator.
ECMAScript syntax intentionally resembles Java syntax. ECMAScript
syntax is relaxed to enable it to serve as an easy-to-use scripting
language. For example, a variable is not required to have its type
declared nor are types associated with properties, and defined
functions are not required to have their declarations appear textually
before calls to them.