forked from williamkapke/node-compat-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testers.json
3881 lines (3881 loc) · 336 KB
/
testers.json
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
{
"ES2015": {
"optimisation›proper tail calls (tail call optimisation)›direct recursion": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-tail-position-calls",
"code": "\"use strict\";\nreturn (function f(n){\n if (n <= 0) {\n return \"foo\";\n }\n return f(n - 1);\n}(1e6)) === \"foo\";"
},
"optimisation›proper tail calls (tail call optimisation)›mutual recursion": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-tail-position-calls",
"code": "\"use strict\";\nfunction f(n){\n if (n <= 0) {\n return \"foo\";\n }\n return g(n - 1);\n}\nfunction g(n){\n if (n <= 0) {\n return \"bar\";\n }\n return f(n - 1);\n}\nreturn f(1e6) === \"foo\" && f(1e6+1) === \"bar\";"
},
"syntax›default function parameters›basic functionality": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return (function (a = 1, b = 2) { return a === 3 && b === 2; }(3));"
},
"syntax›default function parameters›explicit undefined defers to the default": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return (function (a = 1, b = 2) { return a === 1 && b === 3; }(undefined, 3));"
},
"syntax›default function parameters›defaults can refer to previous params": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return (function (a, b = a) { return b === 5; }(5));"
},
"syntax›default function parameters›arguments object interaction": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return (function (a = \"baz\", b = \"qux\", c = \"quux\") {\n a = \"corge\";\n // The arguments object is not mapped to the\n // parameters, even outside of strict mode.\n return arguments.length === 2\n && arguments[0] === \"foo\"\n && arguments[1] === \"bar\";\n}(\"foo\", \"bar\"));"
},
"syntax›default function parameters›temporal dead zone": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return (function(x = 1) {\n try {\n eval(\"(function(a=a){}())\");\n return false;\n } catch(e) {}\n try {\n eval(\"(function(a=b,b){}())\");\n return false;\n } catch(e) {}\n return true;\n}());"
},
"syntax›default function parameters›separate scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return (function(a=function(){\n return typeof b === 'undefined';\n}){\n var b = 1;\n return a();\n}());"
},
"syntax›default function parameters›new Function() support": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "return new Function(\"a = 1\", \"b = 2\",\n \"return a === 3 && b === 2;\"\n)(3);"
},
"syntax›rest parameters›basic functionality": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions",
"code": "return (function (foo, ...args) {\n return args instanceof Array && args + \"\" === \"bar,baz\";\n}(\"foo\", \"bar\", \"baz\"));"
},
"syntax›rest parameters›function 'length' property": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions",
"code": "return function(a, ...b){}.length === 1 && function(...c){}.length === 0;"
},
"syntax›rest parameters›arguments object interaction": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions",
"code": "return (function (foo, ...args) {\n foo = \"qux\";\n // The arguments object is not mapped to the\n // parameters, even outside of strict mode.\n return arguments.length === 3\n && arguments[0] === \"foo\"\n && arguments[1] === \"bar\"\n && arguments[2] === \"baz\";\n}(\"foo\", \"bar\", \"baz\"));"
},
"syntax›rest parameters›can't be used in setters": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions",
"code": "return (function (...args) {\n try {\n eval(\"({set e(...args){}})\");\n } catch(e) {\n return true;\n }\n}());"
},
"syntax›rest parameters›new Function() support": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions",
"code": "return new Function(\"a\", \"...b\",\n \"return b instanceof Array && a+b === 'foobar,baz';\"\n)('foo','bar','baz');"
},
"syntax›spread syntax for iterable objects›with arrays, in function calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "return Math.max(...[1, 2, 3]) === 3"
},
"syntax›spread syntax for iterable objects›with arrays, in array literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "return [...[1, 2, 3]][2] === 3;"
},
"syntax›spread syntax for iterable objects›with sparse arrays, in function calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var a = Array(...[,,]);\nreturn \"0\" in a && \"1\" in a && '' + a[0] + a[1] === \"undefinedundefined\";"
},
"syntax›spread syntax for iterable objects›with sparse arrays, in array literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var a = [...[,,]];\nreturn \"0\" in a && \"1\" in a && '' + a[0] + a[1] === \"undefinedundefined\";"
},
"syntax›spread syntax for iterable objects›with strings, in function calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "return Math.max(...\"1234\") === 4;"
},
"syntax›spread syntax for iterable objects›with strings, in array literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "return [\"a\", ...\"bcd\", \"e\"][3] === \"d\";"
},
"syntax›spread syntax for iterable objects›with astral plane strings, in function calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "return Array(...\"𠮷𠮶\")[0] === \"𠮷\";"
},
"syntax›spread syntax for iterable objects›with astral plane strings, in array literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "return [...\"𠮷𠮶\"][0] === \"𠮷\";"
},
"syntax›spread syntax for iterable objects›with generator instances, in calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var iterable = (function*(){ yield 1; yield 2; yield 3; }());\nreturn Math.max(...iterable) === 3;"
},
"syntax›spread syntax for iterable objects›with generator instances, in arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var iterable = (function*(){ yield \"b\"; yield \"c\"; yield \"d\"; }());\nreturn [\"a\", ...iterable, \"e\"][3] === \"d\";"
},
"syntax›spread syntax for iterable objects›with generic iterables, in calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var iterable = global.__createIterableObject([1, 2, 3]);\nreturn Math.max(...iterable) === 3;"
},
"syntax›spread syntax for iterable objects›with generic iterables, in arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var iterable = global.__createIterableObject([\"b\", \"c\", \"d\"]);\nreturn [\"a\", ...iterable, \"e\"][3] === \"d\";"
},
"syntax›spread syntax for iterable objects›with instances of iterables, in calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var iterable = global.__createIterableObject([1, 2, 3]);\nreturn Math.max(...Object.create(iterable)) === 3;"
},
"syntax›spread syntax for iterable objects›with instances of iterables, in arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "var iterable = global.__createIterableObject([\"b\", \"c\", \"d\"]);\nreturn [\"a\", ...Object.create(iterable), \"e\"][3] === \"d\";"
},
"syntax›spread syntax for iterable objects›spreading non-iterables is a runtime error": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation",
"code": "try {\n Math.max(...2);\n} catch(e) {\n return Math.max(...[1, 2, 3]) === 3;\n}"
},
"syntax›object literal extensions›computed properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-object-initialiser",
"code": "var x = 'y';\nreturn ({ [x]: 1 }).y === 1;"
},
"syntax›object literal extensions›shorthand properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-object-initialiser",
"code": "var a = 7, b = 8, c = {a,b};\nreturn c.a === 7 && c.b === 8;"
},
"syntax›object literal extensions›shorthand methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-object-initialiser",
"code": "return ({ y() { return 2; } }).y() === 2;"
},
"syntax›object literal extensions›string-keyed shorthand methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-object-initialiser",
"code": "return ({ \"foo bar\"() { return 4; } })[\"foo bar\"]() === 4;"
},
"syntax›object literal extensions›computed shorthand methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-object-initialiser",
"code": "var x = 'y';\nreturn ({ [x](){ return 1 } }).y() === 1;"
},
"syntax›object literal extensions›computed accessors": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-object-initialiser",
"code": "var x = 'y',\n valueSet,\n obj = {\n get [x] () { return 1 },\n set [x] (value) { valueSet = value }\n };\nobj.y = 'foo';\nreturn obj.y === 1 && valueSet === 'foo';"
},
"syntax›for..of loops›with arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var arr = [5];\nfor (var item of arr)\n return item === 5;"
},
"syntax›for..of loops›with sparse arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var arr = [,,];\nvar count = 0;\nfor (var item of arr)\n count += (item === void undefined);\nreturn count === 2;"
},
"syntax›for..of loops›with strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var str = \"\";\nfor (var item of \"foo\")\n str += item;\nreturn str === \"foo\";"
},
"syntax›for..of loops›with astral plane strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var str = \"\";\nfor (var item of \"𠮷𠮶\")\n str += item + \" \";\nreturn str === \"𠮷 𠮶 \";"
},
"syntax›for..of loops›with generator instances": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var result = \"\";\nvar iterable = (function*(){ yield 1; yield 2; yield 3; }());\nfor (var item of iterable) {\n result += item;\n}\nreturn result === \"123\";"
},
"syntax›for..of loops›with generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var result = \"\";\nvar iterable = global.__createIterableObject([1, 2, 3]);\nfor (var item of iterable) {\n result += item;\n}\nreturn result === \"123\";"
},
"syntax›for..of loops›with instances of generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var result = \"\";\nvar iterable = global.__createIterableObject([1, 2, 3]);\nfor (var item of Object.create(iterable)) {\n result += item;\n}\nreturn result === \"123\";"
},
"syntax›for..of loops›iterator closing, break": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var closed = false;\nvar iter = __createIterableObject([1, 2, 3], {\n 'return': function(){ closed = true; return {}; }\n});\nfor (var it of iter) break;\nreturn closed;"
},
"syntax›for..of loops›iterator closing, throw": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements",
"code": "var closed = false;\nvar iter = __createIterableObject([1, 2, 3], {\n 'return': function(){ closed = true; return {}; }\n});\ntry {\n for (var it of iter) throw 0;\n} catch(e){}\nreturn closed;"
},
"syntax›octal and binary literals›octal literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-numeric-literals",
"code": "return 0o10 === 8 && 0O10 === 8;"
},
"syntax›octal and binary literals›binary literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-numeric-literals",
"code": "return 0b10 === 2 && 0B10 === 2;"
},
"syntax›octal and binary literals›octal supported by Number()": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-numeric-literals",
"code": "return Number('0o1') === 1;"
},
"syntax›octal and binary literals›binary supported by Number()": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-numeric-literals",
"code": "return Number('0b1') === 1;"
},
"syntax›template literals›basic functionality": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "var a = \"ba\", b = \"QUX\";\nreturn `foo bar\n${a + \"z\"} ${b.toLowerCase()}` === \"foo bar\\nbaz qux\";"
},
"syntax›template literals›toString conversion": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "var a = {\n toString: function() { return \"foo\"; },\n valueOf: function() { return \"bar\"; }\n};\nreturn `${a}` === \"foo\";"
},
"syntax›template literals›tagged template literals": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "var called = false;\nfunction fn(parts, a, b) {\n called = true;\n return parts instanceof Array &&\n parts[0] === \"foo\" &&\n parts[1] === \"bar\\n\" &&\n parts.raw[0] === \"foo\" &&\n parts.raw[1] === \"bar\\\\n\" &&\n a === 123 &&\n b === 456;\n}\nreturn fn `foo${123}bar\\n${456}` && called;"
},
"syntax›template literals›passed array is frozen": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "return (function(parts) {\n return Object.isFrozen(parts) && Object.isFrozen(parts.raw);\n}) `foo${0}bar${0}baz`;"
},
"syntax›template literals›line break normalisation": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "var cr = eval(\"`x\" + String.fromCharCode(13) + \"y`\");\nvar lf = eval(\"`x\" + String.fromCharCode(10) + \"y`\");\nvar crlf = eval(\"`x\" + String.fromCharCode(13,10) + \"y`\");\n\nreturn cr.length === 3 && lf.length === 3 && crlf.length === 3\n && cr[1] === lf[1] && lf[1] === crlf[1] && crlf[1] === '\\n';"
},
"syntax›template literals›TemplateStrings call site caching": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "// TemplateStrings caching was changed from per-contents to\n// per-call-site.\n// https://github.com/tc39/ecma262/pull/890\nfunction strings(array) {\n return array;\n}\nfunction getStrings() {\n return strings`foo`;\n}\nvar original = getStrings();\nvar other = strings`foo`;\nreturn original === getStrings() && original !== other;"
},
"syntax›template literals›TemplateStrings permanent caching": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-template-literals",
"code": "function strings(array) {\n return array;\n}\nfunction getStrings() {\n return strings`foo`;\n}\nvar original = getStrings();\nvar newed = new getStrings();\nreturn original === getStrings() && original === newed;"
},
"syntax›RegExp \"y\" and \"u\" flags›\"y\" flag": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.sticky",
"code": "var re = new RegExp('\\\\w', 'y');\nre.exec('xy');\nreturn (re.exec('xy')[0] === 'y');"
},
"syntax›RegExp \"y\" and \"u\" flags›\"y\" flag, lastIndex": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.sticky",
"code": "var re = new RegExp('yy', 'y');\nre.lastIndex = 3;\nvar result = re.exec('xxxyyxx')[0];\nreturn result === 'yy' && re.lastIndex === 5;"
},
"syntax›RegExp \"y\" and \"u\" flags›\"u\" flag": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.sticky",
"code": "return \"𠮷\".match(/^.$/u)[0].length === 2;"
},
"syntax›RegExp \"y\" and \"u\" flags›\"u\" flag, non-BMP Unicode characters": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.sticky",
"code": "return \"𠮷x\".match(/^.x$/u)[0].length === 3;"
},
"syntax›RegExp \"y\" and \"u\" flags›\"u\" flag, Unicode code point escapes": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.sticky",
"code": "return \"𝌆\".match(/\\u{1d306}/u)[0].length === 2;"
},
"syntax›RegExp \"y\" and \"u\" flags›\"u\" flag, case folding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.sticky",
"code": "return \"ſ\".match(/S/iu) && \"S\".match(/ſ/iu);"
},
"syntax›destructuring, declarations›with arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, , [b], c] = [5, null, [6]];\nreturn a === 5 && b === 6 && c === void undefined;"
},
"syntax›destructuring, declarations›with sparse arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, , b] = [,,,];\nreturn a === void undefined && b === void undefined;"
},
"syntax›destructuring, declarations›with strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, b, c] = \"ab\";\nreturn a === \"a\" && b === \"b\" && c === void undefined;"
},
"syntax›destructuring, declarations›with astral plane strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [c] = \"𠮷𠮶\";\nreturn c === \"𠮷\";"
},
"syntax›destructuring, declarations›with generator instances": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, b, c] = (function*(){ yield 1; yield 2; }());\nreturn a === 1 && b === 2 && c === void undefined;"
},
"syntax›destructuring, declarations›with generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, b, c] = global.__createIterableObject([1, 2]);\nreturn a === 1 && b === 2 && c === void undefined;"
},
"syntax›destructuring, declarations›with instances of generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, b, c] = Object.create(global.__createIterableObject([1, 2]));\nreturn a === 1 && b === 2 && c === void undefined;"
},
"syntax›destructuring, declarations›iterator closing": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var closed = false;\nvar iter = global.__createIterableObject([1, 2, 3], {\n 'return': function(){ closed = true; return {}; }\n});\nvar [a, b] = iter;\nreturn closed;"
},
"syntax›destructuring, declarations›trailing commas in iterable patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a,] = [1];\nreturn a === 1;"
},
"syntax›destructuring, declarations›with objects": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var {c, x:d, e} = {c:7, x:8};\nreturn c === 7 && d === 8 && e === void undefined;"
},
"syntax›destructuring, declarations›object destructuring with primitives": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var {toFixed} = 2;\nvar {slice} = '';\nreturn toFixed === Number.prototype.toFixed\n && slice === String.prototype.slice;"
},
"syntax›destructuring, declarations›trailing commas in object patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var {a,} = {a:1};\nreturn a === 1;"
},
"syntax›destructuring, declarations›throws on null and undefined": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "try {\n var {a} = null;\n return false;\n} catch(e) {\n if (!(e instanceof TypeError))\n return false;\n}\ntry {\n var {b} = void undefined;\n return false;\n} catch(e) {\n if (!(e instanceof TypeError))\n return false;\n}\nreturn true;"
},
"syntax›destructuring, declarations›computed properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var qux = \"corge\";\nvar { [qux]: grault } = { corge: \"garply\" };\nreturn grault === \"garply\";"
},
"syntax›destructuring, declarations›multiples in a single var statement": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a,b] = [5,6], {c,d} = {c:7,d:8};\nreturn a === 5 && b === 6 && c === 7 && d === 8;"
},
"syntax›destructuring, declarations›nested": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [e, {x:f, g}] = [9, {x:10}];\nvar {h, x:[i]} = {h:11, x:[12]};\nreturn e === 9 && f === 10 && g === void undefined\n && h === 11 && i === 12;"
},
"syntax›destructuring, declarations›in for-in loop heads": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "for(var [i, j, k] in { qux: 1 }) {\n return i === \"q\" && j === \"u\" && k === \"x\";\n}"
},
"syntax›destructuring, declarations›in for-of loop heads": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "for(var [i, j, k] of [[1,2,3]]) {\n return i === 1 && j === 2 && k === 3;\n}"
},
"syntax›destructuring, declarations›in catch heads": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "try {\n throw [1,2];\n} catch([i,j]) {\n try {\n throw { k: 3, l: 4 };\n } catch({k, l}) {\n return i === 1 && j === 2 && k === 3 && l === 4;\n }\n}"
},
"syntax›destructuring, declarations›rest": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var [a, ...b] = [3, 4, 5];\nvar [c, ...d] = [6];\nreturn a === 3 && b instanceof Array && (b + \"\") === \"4,5\" &&\n c === 6 && d instanceof Array && d.length === 0;"
},
"syntax›destructuring, declarations›defaults": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var {a = 1, b = 0, z:c = 3} = {b:2, z:undefined};\nvar [d = 0, e = 5, f = 6] = [4,,undefined];\nreturn a === 1 && b === 2 && c === 3\n && d === 4 && e === 5 && f === 6;"
},
"syntax›destructuring, declarations›defaults, let temporal dead zone": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var {a, b = 2} = {a:1};\ntry {\n eval(\"let {c = c} = {};\");\n return false;\n} catch(e){}\ntry {\n eval(\"let {c = d, d} = {d:1};\");\n return false;\n} catch(e){}\nreturn a === 1 && b === 2;"
},
"syntax›destructuring, assignment›with arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c;\n[a, , [b], c] = [5, null, [6]];\nreturn a === 5 && b === 6 && c === void undefined;"
},
"syntax›destructuring, assignment›with sparse arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a, b;\n[a, , b] = [,,,];\nreturn a === void undefined && b === void undefined;"
},
"syntax›destructuring, assignment›with strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c;\n[a, b, c] = \"ab\";\nreturn a === \"a\" && b === \"b\" && c === void undefined;"
},
"syntax›destructuring, assignment›with astral plane strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var c;\n[c] = \"𠮷𠮶\";\nreturn c === \"𠮷\";"
},
"syntax›destructuring, assignment›with generator instances": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c;\n[a, b, c] = (function*(){ yield 1; yield 2; }());\nreturn a === 1 && b === 2 && c === void undefined;"
},
"syntax›destructuring, assignment›with generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c;\n[a, b, c] = global.__createIterableObject([1, 2]);\nreturn a === 1 && b === 2 && c === void undefined;"
},
"syntax›destructuring, assignment›with instances of generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c;\n[a, b, c] = Object.create(global.__createIterableObject([1, 2]));\nreturn a === 1 && b === 2 && c === void undefined;"
},
"syntax›destructuring, assignment›iterator closing": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var closed = false;\nvar iter = global.__createIterableObject([1, 2, 3], {\n 'return': function(){ closed = true; return {}; }\n});\nvar a,b;\n[a, b] = iter;\nreturn closed;"
},
"syntax›destructuring, assignment›iterable destructuring expression": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a, b, iterable = [1,2];\nreturn ([a, b] = iterable) === iterable;"
},
"syntax›destructuring, assignment›chained iterable destructuring": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c,d;\n[a,b] = [c,d] = [1,2];\nreturn a === 1 && b === 2 && c === 1 && d === 2;"
},
"syntax›destructuring, assignment›trailing commas in iterable patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a;\n[a,] = [1];\nreturn a === 1;"
},
"syntax›destructuring, assignment›with objects": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var c,d,e;\n({c, x:d, e} = {c:7, x:8});\nreturn c === 7 && d === 8 && e === void undefined;"
},
"syntax›destructuring, assignment›object destructuring with primitives": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var toFixed, slice;\n({toFixed} = 2);\n({slice} = '');\nreturn toFixed === Number.prototype.toFixed\n && slice === String.prototype.slice;"
},
"syntax›destructuring, assignment›trailing commas in object patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a;\n({a,} = {a:1});\nreturn a === 1;"
},
"syntax›destructuring, assignment›object destructuring expression": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a, b, obj = { a:1, b:2 };\nreturn ({a,b} = obj) === obj;"
},
"syntax›destructuring, assignment›parenthesised left-hand-side is a syntax error": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a, b;\n({a,b} = {a:1,b:2});\ntry {\n eval(\"({a,b}) = {a:3,b:4};\");\n}\ncatch(e) {\n return a === 1 && b === 2;\n}"
},
"syntax›destructuring, assignment›chained object destructuring": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c,d;\n({a,b} = {c,d} = {a:1,b:2,c:3,d:4});\nreturn a === 1 && b === 2 && c === 3 && d === 4;"
},
"syntax›destructuring, assignment›throws on null and undefined": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b;\ntry {\n ({a} = null);\n return false;\n} catch(e) {\n if (!(e instanceof TypeError))\n return false;\n}\ntry {\n ({b} = void undefined);\n return false;\n} catch(e) {\n if (!(e instanceof TypeError))\n return false;\n}\nreturn true;"
},
"syntax›destructuring, assignment›computed properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var grault, qux = \"corge\";\n({ [qux]: grault } = { corge: \"garply\" });\nreturn grault === \"garply\";"
},
"syntax›destructuring, assignment›nested": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var e,f,g,h,i;\n[e, {x:f, g}] = [9, {x:10}];\n({h, x:[i]} = {h:11, x:[12]});\nreturn e === 9 && f === 10 && g === void undefined\n && h === 11 && i === 12;"
},
"syntax›destructuring, assignment›rest": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c,d;\n[a, ...b] = [3, 4, 5];\n[c, ...d] = [6];\nreturn a === 3 && b instanceof Array && (b + \"\") === \"4,5\" &&\n c === 6 && d instanceof Array && d.length === 0;"
},
"syntax›destructuring, assignment›nested rest": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a = [1, 2, 3], first, last;\n[first, ...[a[2], last]] = a;\nreturn first === 1 && last === 3 && (a + \"\") === \"1,2,2\";"
},
"syntax›destructuring, assignment›empty patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "[] = [1,2];\n({} = {a:1,b:2});\nreturn true;"
},
"syntax›destructuring, assignment›defaults": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var a,b,c,d,e,f;\n({a = 1, b = 0, z:c = 3} = {b:2, z:undefined});\n[d = 0, e = 5, f = 6] = [4,,undefined];\nreturn a === 1 && b === 2 && c === 3\n && d === 4 && e === 5 && f === 6;"
},
"syntax›destructuring, parameters›with arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, , [b], c]) {\n return a === 5 && b === 6 && c === void undefined;\n}([5, null, [6]]);"
},
"syntax›destructuring, parameters›with sparse arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, , b]) {\n return a === void undefined && b === void undefined;\n}([,,,]);"
},
"syntax›destructuring, parameters›with strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, b, c]) {\n return a === \"a\" && b === \"b\" && c === void undefined;\n}(\"ab\");"
},
"syntax›destructuring, parameters›with astral plane strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([c]) {\n return c === \"𠮷\";\n}(\"𠮷𠮶\");"
},
"syntax›destructuring, parameters›with generator instances": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, b, c]) {\n return a === 1 && b === 2 && c === void undefined;\n}(function*(){ yield 1; yield 2; }());"
},
"syntax›destructuring, parameters›with generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, b, c]) {\n return a === 1 && b === 2 && c === void undefined;\n}(global.__createIterableObject([1, 2]));"
},
"syntax›destructuring, parameters›with instances of generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, b, c]) {\n return a === 1 && b === 2 && c === void undefined;\n}(Object.create(global.__createIterableObject([1, 2])));"
},
"syntax›destructuring, parameters›iterator closing": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var closed = false;\nvar iter = global.__createIterableObject([1, 2, 3], {\n 'return': function(){ closed = true; return {}; }\n});\n(function([a,b]) {}(iter));\nreturn closed;"
},
"syntax›destructuring, parameters›trailing commas in iterable patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a,]) {\n return a === 1;\n}([1]);"
},
"syntax›destructuring, parameters›with objects": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function({c, x:d, e}) {\n return c === 7 && d === 8 && e === void undefined;\n}({c:7, x:8});"
},
"syntax›destructuring, parameters›object destructuring with primitives": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function({toFixed}, {slice}) {\n return toFixed === Number.prototype.toFixed\n && slice === String.prototype.slice;\n}(2,'');"
},
"syntax›destructuring, parameters›trailing commas in object patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function({a,}) {\n return a === 1;\n}({a:1});"
},
"syntax›destructuring, parameters›throws on null and undefined": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "try {\n (function({a}){}(null));\n return false;\n} catch(e) {}\ntry {\n (function({b}){}(undefined));\n return false;\n} catch(e) {}\nreturn true;"
},
"syntax›destructuring, parameters›computed properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "var qux = \"corge\";\nreturn function({ [qux]: grault }) {\n return grault === \"garply\";\n}({ corge: \"garply\" });"
},
"syntax›destructuring, parameters›nested": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([e, {x:f, g}], {h, x:[i]}) {\n return e === 9 && f === 10 && g === void undefined\n && h === 11 && i === 12;\n}([9, {x:10}],{h:11, x:[12]});"
},
"syntax›destructuring, parameters›'arguments' interaction": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return (function({a, x:b, y:e}, [c, d]) {\n return arguments[0].a === 1 && arguments[0].x === 2\n && !(\"y\" in arguments[0]) && arguments[1] + '' === \"3,4\";\n}({a:1, x:2}, [3, 4]));"
},
"syntax›destructuring, parameters›new Function() support": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return new Function(\"{a, x:b, y:e}\",\"[c, d]\",\n \"return a === 1 && b === 2 && c === 3 && \"\n + \"d === 4 && e === void undefined;\"\n)({a:1, x:2}, [3, 4]);"
},
"syntax›destructuring, parameters›in parameters, function 'length' property": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function({a, b}, [c, d]){}.length === 2;"
},
"syntax›destructuring, parameters›rest": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function([a, ...b], [c, ...d]) {\n return a === 3 && b instanceof Array && (b + \"\") === \"4,5\" &&\n c === 6 && d instanceof Array && d.length === 0;\n}([3, 4, 5], [6]);"
},
"syntax›destructuring, parameters›empty patterns": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return function ([],{}){\n return arguments[0] + '' === \"3,4\" && arguments[1].x === \"foo\";\n}([3,4],{x:\"foo\"});"
},
"syntax›destructuring, parameters›defaults": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return (function({a = 1, b = 0, c = 3, x:d = 0, y:e = 5},\n [f = 6, g = 0, h = 8]) {\n return a === 1 && b === 2 && c === 3 && d === 4 &&\n e === 5 && f === 6 && g === 7 && h === 8;\n}({b:2, c:undefined, x:4},[, 7, undefined]));"
},
"syntax›destructuring, parameters›defaults, separate scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return (function({a=function(){\n return typeof b === 'undefined';\n}}){\n var b = 1;\n return a();\n}({}));"
},
"syntax›destructuring, parameters›defaults, new Function() support": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return new Function(\"{a = 1, b = 0, c = 3, x:d = 0, y:e = 5}\",\n \"return a === 1 && b === 2 && c === 3 && d === 4 && e === 5;\"\n)({b:2, c:undefined, x:4});"
},
"syntax›destructuring, parameters›aliased defaults, arrow function": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return ((a, {b: x = 0, c: y = 3}) => {\n return a === 1 && x === 2 && y === 3;\n})(1, {b: 2});"
},
"syntax›destructuring, parameters›shorthand defaults, arrow function": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "return ((a, {b = 0, c = 3}) => {\n return a === 1 && b === 2 && c === 3;\n})(1, {b: 2});"
},
"syntax›destructuring, parameters›duplicate identifier": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment",
"code": "try {\n eval('var d = function d([d]) { return d };');\n if (d([true]) !== true) return false;\n} catch (e) {\n return !(e instanceof SyntaxError);\n}\n\ntry {\n eval('var f = function f([id, id]) { return id }');\n return false;\n} catch (e) {\n return e instanceof SyntaxError;\n}"
},
"syntax›Unicode code point escapes›in strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-string-literals",
"code": "return '\\u{1d306}' === '\\ud834\\udf06';"
},
"syntax›Unicode code point escapes›in identifiers": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-string-literals",
"code": "var \\u{102C0} = 2;\nreturn \\u{102C0} === 2;"
},
"syntax›Unicode code point escapes›in property key definitions": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-string-literals",
"code": "var o = { \\u{102C0} : 2 };\nreturn o['\\ud800\\udec0'] === 2;"
},
"syntax›Unicode code point escapes›in property key accesses": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-literals-string-literals",
"code": "var o = { '\\ud800\\udec0' : 2 };\nreturn o.\\u{102C0} === 2;"
},
"syntax›new.target›in constructors": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-built-in-function-objects",
"code": "var passed = false;\nnew function f() {\n passed = (new.target === f);\n}();\n(function() {\n passed &= (new.target === void undefined);\n}());\nreturn passed;"
},
"syntax›new.target›assignment is an early error": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-built-in-function-objects",
"code": "var passed = false;\nnew function f() {\n passed = (new.target === f);\n}();\n\ntry {\n Function(\"new.target = function(){};\");\n} catch(e) {\n return passed;\n}"
},
"bindings›const›basic support": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "const foo = 123;\nreturn (foo === 123);"
},
"bindings›const›is block-scoped": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "const bar = 123;\n{ const bar = 456; }\nreturn bar === 123;"
},
"bindings›const›scope shadow resolution": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "try {\n { const bar = 456; }\n const bar = 123;\n return bar === 123;\n} catch(e) {\n return false;\n}"
},
"bindings›const›cannot be in statements": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "const bar = 1;\ntry {\n Function(\"if(true) const baz = 1;\")();\n} catch(e) {\n return true;\n}"
},
"bindings›const›redefining a const is an error": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "const baz = 1;\ntry {\n Function(\"const foo = 1; foo = 2;\")();\n} catch(e) {\n return true;\n}"
},
"bindings›const›for loop statement scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "const baz = 1;\nfor(const baz = 0; false;) {}\nreturn baz === 1;"
},
"bindings›const›for-in loop iteration scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "var scopes = [];\nfor(const i in { a:1, b:1 }) {\n scopes.push(function(){ return i; });\n}\nreturn (scopes[0]() === \"a\" && scopes[1]() === \"b\");"
},
"bindings›const›for-of loop iteration scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "var scopes = [];\nfor(const i of ['a','b']) {\n scopes.push(function(){ return i; });\n}\nreturn (scopes[0]() === \"a\" && scopes[1]() === \"b\");"
},
"bindings›const›temporal dead zone": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "var passed = (function(){ try { qux; } catch(e) { return true; }}());\nfunction fn() { passed &= qux === 456; }\nconst qux = 456;\nfn();\nreturn passed;"
},
"bindings›const›basic support (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "\"use strict\";\nconst foo = 123;\nreturn (foo === 123);"
},
"bindings›const›is block-scoped (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nconst bar = 123;\n{ const bar = 456; }\nreturn bar === 123;"
},
"bindings›const›scope shadow resolution (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\ntry {\n { const bar = 456; }\n const bar = 123;\n return bar === 123;\n} catch(e) {\n return false;\n}"
},
"bindings›const›cannot be in statements (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nconst bar = 1;\ntry {\n Function(\"'use strict'; if(true) const baz = 1;\")();\n} catch(e) {\n return true;\n}"
},
"bindings›const›redefining a const (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nconst baz = 1;\ntry {\n Function(\"'use strict'; const foo = 1; foo = 2;\")();\n} catch(e) {\n return true;\n}"
},
"bindings›const›for loop statement scope (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nconst baz = 1;\nfor(const baz = 0; false;) {}\nreturn baz === 1;"
},
"bindings›const›for-in loop iteration scope (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nvar scopes = [];\nfor(const i in { a:1, b:1 }) {\n scopes.push(function(){ return i; });\n}\nreturn (scopes[0]() === \"a\" && scopes[1]() === \"b\");"
},
"bindings›const›for-of loop iteration scope (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nvar scopes = [];\nfor(const i of ['a','b']) {\n scopes.push(function(){ return i; });\n}\nreturn (scopes[0]() === \"a\" && scopes[1]() === \"b\");"
},
"bindings›const›temporal dead zone (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nvar passed = (function(){ try { qux; } catch(e) { return true; }}());\nfunction fn() { passed &= qux === 456; }\nconst qux = 456;\nfn();\nreturn passed;"
},
"bindings›let›basic support": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "let foo = 123;\nreturn (foo === 123);"
},
"bindings›let›is block-scoped": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "let bar = 123;\n{ let bar = 456; }\nreturn bar === 123;"
},
"bindings›let›scope shadow resolution": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "try {\n { let bar = 456; }\n let bar = 123;\n return bar === 123;\n} catch(e) {\n return false;\n}"
},
"bindings›let›cannot be in statements": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "let bar = 1;\ntry {\n Function(\"if(true) let baz = 1;\")();\n} catch(e) {\n return true;\n}"
},
"bindings›let›for loop statement scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "let baz = 1;\nfor(let baz = 0; false;) {}\nreturn baz === 1;"
},
"bindings›let›temporal dead zone": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "var passed = (function(){ try { qux; } catch(e) { return true; }}());\nfunction fn() { passed &= qux === 456; }\nlet qux = 456;\nfn();\nreturn passed;"
},
"bindings›let›for/for-in loop iteration scope": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "let scopes = [];\nfor(let i = 0; i < 2; i++) {\n scopes.push(function(){ return i; });\n}\nlet passed = (scopes[0]() === 0 && scopes[1]() === 1);\n\nscopes = [];\nfor(let i in { a:1, b:1 }) {\n scopes.push(function(){ return i; });\n}\npassed &= (scopes[0]() === \"a\" && scopes[1]() === \"b\");\nreturn passed;"
},
"bindings›let›for-in loop binding shadowing parameter": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "try {\n Function(\"function f(e) { for (let e in {}) e }\");\n return true;\n} catch(e) {\n return false;\n}"
},
"bindings›let›basic support (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nlet foo = 123;\nreturn (foo === 123);"
},
"bindings›let›is block-scoped (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nlet bar = 123;\n{ let bar = 456; }\nreturn bar === 123;"
},
"bindings›let›scope shadow resolution (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\ntry {\n { let bar = 456; }\n let bar = 123;\n return bar === 123;\n} catch(e) {\n return false;\n}"
},
"bindings›let›cannot be in statements (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nlet bar = 1;\ntry {\n Function(\"'use strict'; if(true) let baz = 1;\")();\n} catch(e) {\n return true;\n}"
},
"bindings›let›for loop statement scope (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nlet baz = 1;\nfor(let baz = 0; false;) {}\nreturn baz === 1;"
},
"bindings›let›temporal dead zone (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nvar passed = (function(){ try { qux; } catch(e) { return true; }}());\nfunction fn() { passed &= qux === 456; }\nlet qux = 456;\nfn();\nreturn passed;"
},
"bindings›let›for/for-in loop iteration scope (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "'use strict';\nlet scopes = [];\nfor(let i = 0; i < 2; i++) {\n scopes.push(function(){ return i; });\n}\nlet passed = (scopes[0]() === 0 && scopes[1]() === 1);\n\nscopes = [];\nfor(let i in { a:1, b:1 }) {\n scopes.push(function(){ return i; });\n}\npassed &= (scopes[0]() === \"a\" && scopes[1]() === \"b\");\nreturn passed;"
},
"bindings›let›for-in loop binding shadowing parameter (strict mode)": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations",
"code": "try {\n Function(\"'use strict'; function f(e) { for (let e in {}) e }\");\n return true;\n} catch(e) {\n return false;\n}"
},
"bindings›block-level function declaration": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation",
"code": "'use strict';\nif (f() !== 1) return false;\nfunction f() { return 1; }\n{\n if (f() !== 2) return false;\n function f() { return 2; }\n if (f() !== 2) return false;\n}\nif (f() !== 1) return false;\nreturn true;"
},
"functions›arrow functions›0 parameters": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "return (() => 5)() === 5;"
},
"functions›arrow functions›1 parameter, no brackets": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var b = x => x + \"foo\";\nreturn (b(\"fee fie foe \") === \"fee fie foe foo\");"
},
"functions›arrow functions›multiple parameters": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var c = (v, w, x, y, z) => \"\" + v + w + x + y + z;\nreturn (c(6, 5, 4, 3, 2) === \"65432\");"
},
"functions›arrow functions›lexical \"this\" binding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var d = { x : \"bar\", y : function() { return z => this.x + z; }}.y();\nvar e = { x : \"baz\", y : d };\nreturn d(\"ley\") === \"barley\" && e.y(\"ley\") === \"barley\";"
},
"functions›arrow functions›\"this\" unchanged by call or apply": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var d = { x : \"foo\", y : function() { return () => this.x; }};\nvar e = { x : \"bar\" };\nreturn d.y().call(e) === \"foo\" && d.y().apply(e) === \"foo\";"
},
"functions›arrow functions›can't be bound, can be curried": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var d = { x : \"bar\", y : function() { return z => this.x + z; }};\nvar e = { x : \"baz\" };\nreturn d.y().bind(e, \"ley\")() === \"barley\";"
},
"functions›arrow functions›lexical \"arguments\" binding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var f = (function() { return z => arguments[0]; }(5));\nreturn f(6) === 5;"
},
"functions›arrow functions›no line break between params and =>": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "return (() => {\n try { Function(\"x\\n => 2\")(); } catch(e) { return true; }\n})();"
},
"functions›arrow functions›correct precedence": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "return (() => {\n try { Function(\"0 || () => 2\")(); } catch(e) { return true; }\n})();"
},
"functions›arrow functions›no \"prototype\" property": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var a = () => 5;\nreturn !a.hasOwnProperty(\"prototype\");"
},
"functions›arrow functions›lexical \"super\" binding in constructors": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "var received;\n\nclass B {\n constructor (arg) {\n received = arg;\n }\n}\nclass C extends B {\n constructor () {\n var callSuper = () => super('foo');\n callSuper();\n }\n}\nreturn new C instanceof C && received === 'foo'"
},
"functions›arrow functions›lexical \"super\" binding in methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "class B {\n qux() {\n return \"quux\";\n }\n}\nclass C extends B {\n baz() {\n return x => super.qux();\n }\n}\nvar arrow = new C().baz();\nreturn arrow() === \"quux\";"
},
"functions›arrow functions›lexical \"new.target\" binding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions",
"code": "function C() {\n return x => new.target;\n}\nreturn new C()() === C && C()() === void undefined;"
},
"functions›class›class statement": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {}\nreturn typeof C === \"function\";"
},
"functions›class›is block-scoped": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {}\nvar c1 = C;\n{\n class C {}\n var c2 = C;\n}\nreturn C === c1;"
},
"functions›class›class expression": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "return typeof class C {} === \"function\";"
},
"functions›class›anonymous class": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "return typeof class {} === \"function\";"
},
"functions›class›constructor": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n constructor() { this.x = 1; }\n}\nreturn C.prototype.constructor === C\n && new C().x === 1;"
},
"functions›class›prototype methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n method() { return 2; }\n}\nreturn typeof C.prototype.method === \"function\"\n && new C().method() === 2;"
},
"functions›class›string-keyed methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n \"foo bar\"() { return 2; }\n}\nreturn typeof C.prototype[\"foo bar\"] === \"function\"\n && new C()[\"foo bar\"]() === 2;"
},
"functions›class›computed prototype methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var foo = \"method\";\nclass C {\n [foo]() { return 2; }\n}\nreturn typeof C.prototype.method === \"function\"\n && new C().method() === 2;"
},
"functions›class›optional semicolons": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n ;\n method() { return 2; };\n method2() { return 2; }\n method3() { return 2; };\n}\nreturn typeof C.prototype.method === \"function\"\n && typeof C.prototype.method2 === \"function\"\n && typeof C.prototype.method3 === \"function\";"
},
"functions›class›static methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n static method() { return 3; }\n}\nreturn typeof C.method === \"function\"\n && C.method() === 3;"
},
"functions›class›computed static methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var foo = \"method\";\nclass C {\n static [foo]() { return 3; }\n}\nreturn typeof C.method === \"function\"\n && C.method() === 3;"
},
"functions›class›accessor properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var baz = false;\nclass C {\n get foo() { return \"foo\"; }\n set bar(x) { baz = x; }\n}\nnew C().bar = true;\nreturn new C().foo === \"foo\" && baz;"
},
"functions›class›computed accessor properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var garply = \"foo\", grault = \"bar\", baz = false;\nclass C {\n get [garply]() { return \"foo\"; }\n set [grault](x) { baz = x; }\n}\nnew C().bar = true;\nreturn new C().foo === \"foo\" && baz;"
},
"functions›class›static accessor properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var baz = false;\nclass C {\n static get foo() { return \"foo\"; }\n static set bar(x) { baz = x; }\n}\nC.bar = true;\nreturn C.foo === \"foo\" && baz;"
},
"functions›class›computed static accessor properties": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var garply = \"foo\", grault = \"bar\", baz = false;\nclass C {\n static get [garply]() { return \"foo\"; }\n static set [grault](x) { baz = x; }\n}\nC.bar = true;\nreturn C.foo === \"foo\" && baz;"
},
"functions›class›class name is lexically scoped": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n method() { return typeof C === \"function\"; }\n}\nvar M = C.prototype.method;\nC = void undefined;\nreturn C === void undefined && M();"
},
"functions›class›computed names, temporal dead zone": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "try {\n var B = class C {\n [C](){}\n }\n} catch(e) {\n return true;\n}"
},
"functions›class›methods aren't enumerable": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n foo() {}\n static bar() {}\n}\nreturn !C.prototype.propertyIsEnumerable(\"foo\") && !C.propertyIsEnumerable(\"bar\");"
},
"functions›class›implicit strict mode": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {\n static method() { return this === void undefined; }\n}\nreturn (0,C.method)();"
},
"functions›class›constructor requires new": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C {}\ntry {\n C();\n}\ncatch(e) {\n return true;\n}"
},
"functions›class›extends": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class B {}\nclass C extends B {}\nreturn new C() instanceof B\n && B.isPrototypeOf(C);"
},
"functions›class›extends expressions": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var B;\nclass C extends (B = class {}) {}\nreturn new C() instanceof B\n && B.isPrototypeOf(C);"
},
"functions›class›extends null": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "class C extends null {\n constructor() { return Object.create(null); }\n}\nreturn Function.prototype.isPrototypeOf(C)\n && Object.getPrototypeOf(C.prototype) === null;"
},
"functions›class›new.target": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions",
"code": "var passed = false;\nnew function f() {\n passed = new.target === f;\n}();\n\nclass A {\n constructor() {\n passed &= new.target === B;\n }\n}\nclass B extends A {}\nnew B();\nreturn passed;"
},
"functions›super›statement in constructors": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "var passed = false;\nclass B {\n constructor(a) { passed = (a === \"barbaz\"); }\n}\nclass C extends B {\n constructor(a) { super(\"bar\" + a); }\n}\nnew C(\"baz\");\nreturn passed;"
},
"functions›super›expression in constructors": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "class B {\n constructor(a) { return [\"foo\" + a]; }\n}\nclass C extends B {\n constructor(a) { return super(\"bar\" + a); }\n}\nreturn new C(\"baz\")[0] === \"foobarbaz\";"
},
"functions›super›in methods, property access": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "class B {}\nB.prototype.qux = \"foo\";\nB.prototype.corge = \"baz\";\nclass C extends B {\n quux(a) { return super.qux + a + super[\"corge\"]; }\n}\nC.prototype.qux = \"garply\";\nreturn new C().quux(\"bar\") === \"foobarbaz\";"
},
"functions›super›in methods, method calls": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "class B {\n qux(a) { return \"foo\" + a; }\n}\nclass C extends B {\n qux(a) { return super.qux(\"bar\" + a); }\n}\nreturn new C().qux(\"baz\") === \"foobarbaz\";"
},
"functions›super›method calls use correct \"this\" binding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "class B {\n qux(a) { return this.foo + a; }\n}\nclass C extends B {\n qux(a) { return super.qux(\"bar\" + a); }\n}\nvar obj = new C();\nobj.foo = \"foo\";\nreturn obj.qux(\"baz\") === \"foobarbaz\";"
},
"functions›super›constructor calls use correct \"new.target\" binding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "var passed;\nclass B {\n constructor() { passed = (new.target === C); }\n}\nclass C extends B {\n constructor() { super(); }\n}\nnew C();\nreturn passed;"
},
"functions›super›is statically bound": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "class B {\n qux() { return \"bar\"; }\n}\nclass C extends B {\n qux() { return super.qux() + this.corge; }\n}\nvar obj = {\n qux: C.prototype.qux,\n corge: \"ley\"\n};\nreturn obj.qux() === \"barley\";"
},
"functions›super›super() invokes the correct constructor": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword",
"code": "// checks that super() is *not* a synonym of super.constructor()\nvar passed;\nclass B {\n constructor() {\n passed = true;\n }\n};\nB.prototype.constructor = function () {\n passed = false;\n};\nclass C extends B { };\nnew C;\nreturn passed;"
},
"functions›generators›basic functionality": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * generator(){\n yield 5; yield 6;\n};\nvar iterator = generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›generator function expressions": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var generator = function * (){\n yield 5; yield 6;\n};\nvar iterator = generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›correct \"this\" binding": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * generator(){\n yield this.x; yield this.y;\n};\nvar iterator = { g: generator, x: 5, y: 6 }.g();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›can't use \"this\" with new": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * generator(){\n yield this.x; yield this.y;\n};\ntry {\n (new generator()).next();\n}\ncatch (e) {\n return true;\n}"
},
"functions›generators›sending": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var sent;\nfunction * generator(){\n sent = [yield 5, yield 6];\n};\nvar iterator = generator();\niterator.next();\niterator.next(\"foo\");\niterator.next(\"bar\");\nreturn sent[0] === \"foo\" && sent[1] === \"bar\";"
},
"functions›generators›%GeneratorPrototype%": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * generatorFn(){}\nvar ownProto = Object.getPrototypeOf(generatorFn());\nvar passed = ownProto === generatorFn.prototype;\n\nvar sharedProto = Object.getPrototypeOf(ownProto);\npassed &= sharedProto !== Object.prototype &&\n sharedProto === Object.getPrototypeOf(function*(){}.prototype) &&\n sharedProto.hasOwnProperty('next');\n\nreturn passed;"
},
"functions›generators›%GeneratorPrototype% prototype chain": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * generatorFn(){}\nvar g = generatorFn();\nvar ownProto = Object.getPrototypeOf(g);\nvar passed = ownProto === generatorFn.prototype;\n\nvar sharedProto = Object.getPrototypeOf(ownProto);\nvar iterProto = Object.getPrototypeOf(sharedProto);\n\npassed &= iterProto.hasOwnProperty(Symbol.iterator) &&\n !sharedProto .hasOwnProperty(Symbol.iterator) &&\n !ownProto .hasOwnProperty(Symbol.iterator) &&\n g[Symbol.iterator]() === g;\n\nreturn passed;"
},
"functions›generators›%GeneratorPrototype%.constructor": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * g (){}\nvar iterator = new g.constructor(\"a\",\"b\",\"c\",\"yield a; yield b; yield c;\")(5,6,7);\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 7 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\n\npassed &= g.constructor === (function*(){}).constructor;\nreturn passed;"
},
"functions›generators›%GeneratorPrototype%.throw": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var passed = false;\nfunction * generator(){\n try {\n yield 5; yield 6;\n } catch(e) {\n passed = (e === \"foo\");\n }\n};\nvar iterator = generator();\niterator.next();\niterator.throw(\"foo\");\nreturn passed;"
},
"functions›generators›%GeneratorPrototype%.return": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "function * generator(){\n yield 5; yield 6;\n};\nvar iterator = generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.return(\"quxquux\");\npassed &= item.value === \"quxquux\" && item.done === true;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield operator precedence": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var passed;\nfunction * generator(){\n passed = yield 0 ? true : false;\n};\nvar iterator = generator();\niterator.next();\niterator.next(true);\nreturn passed;"
},
"functions›generators›yield *, arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * [5, 6];\n}());\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield *, sparse arrays": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * [,,];\n}());\nvar item = iterator.next();\nvar passed = item.value === void undefined && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield *, strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * \"56\";\n}());\nvar item = iterator.next();\nvar passed = item.value === \"5\" && item.done === false;\nitem = iterator.next();\npassed &= item.value === \"6\" && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield *, astral plane strings": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * \"𠮷𠮶\";\n}());\nvar item = iterator.next();\nvar passed = item.value === \"𠮷\" && item.done === false;\nitem = iterator.next();\npassed &= item.value === \"𠮶\" && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield *, generator instances": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * (function*(){ yield 5; yield 6; yield 7; }());\n}());\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 7 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield *, generic iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * global.__createIterableObject([5, 6, 7]);\n}());\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 7 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield *, instances of iterables": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * Object.create(__createIterableObject([5, 6, 7]));\n}());\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 7 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›yield * on non-iterables is a runtime error": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var iterator = (function * generator() {\n yield * [5];\n}());\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\niterator = (function * generator() {\n yield * 5;\n}());\ntry {\n iterator.next();\n} catch (e) {\n return passed;\n}"
},
"functions›generators›yield *, iterator closing": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var closed = '';\nvar iter = __createIterableObject([1, 2, 3], {\n 'return': function(){\n closed += 'a';\n return {done: true};\n }\n});\nvar gen = (function* generator(){\n try {\n yield *iter;\n } finally {\n closed += 'b';\n }\n})();\ngen.next();\ngen['return']();\nreturn closed === 'ab';"
},
"functions›generators›yield *, iterator closing via throw()": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var closed = false;\nvar iter = global.__createIterableObject([1, 2, 3], {\n 'throw': undefined,\n 'return': function() {\n closed = true;\n return {done: true};\n }\n});\nvar gen = (function*(){\n try {\n yield *iter;\n } catch(e){}\n})();\ngen.next();\ngen['throw']();\nreturn closed;"
},
"functions›generators›shorthand generator methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var o = {\n * generator() {\n yield 5; yield 6;\n }\n};\nvar iterator = o.generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›string-keyed shorthand generator methods": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var o = {\n * \"foo bar\"() {\n yield 5; yield 6;\n }\n};\nvar iterator = o[\"foo bar\"]();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›computed shorthand generators": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var garply = \"generator\";\nvar o = {\n * [garply] () {\n yield 5; yield 6;\n }\n};\nvar iterator = o.generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›shorthand generator methods, classes": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "class C {\n * generator() {\n yield 5; yield 6;\n }\n};\nvar iterator = new C().generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›computed shorthand generators, classes": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "var garply = \"generator\";\nclass C {\n * [garply] () {\n yield 5; yield 6;\n }\n}\nvar iterator = new C().generator();\nvar item = iterator.next();\nvar passed = item.value === 5 && item.done === false;\nitem = iterator.next();\npassed &= item.value === 6 && item.done === false;\nitem = iterator.next();\npassed &= item.value === void undefined && item.done === true;\nreturn passed;"
},
"functions›generators›shorthand generators can't be constructors": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions",
"code": "class C {\n * generator() {\n yield 5; yield 6;\n }\n};\ntry {\n Function(\"class D { * constructor() { return {}; } }\");\n} catch(e) {\n return true;\n}"
},
"built-ins›typed arrays›Int8Array": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects",
"code": "var buffer = new ArrayBuffer(64);\nvar view = new Int8Array(buffer); view[0] = 0x80;\nreturn view[0] === -0x80;"
},
"built-ins›typed arrays›Uint8Array": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects",
"code": "var buffer = new ArrayBuffer(64);\nvar view = new Uint8Array(buffer); view[0] = 0x100;\nreturn view[0] === 0;"
},
"built-ins›typed arrays›Uint8ClampedArray": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects",
"code": "var buffer = new ArrayBuffer(64);\nvar view = new Uint8ClampedArray(buffer); view[0] = 0x100;\nreturn view[0] === 0xFF;"
},
"built-ins›typed arrays›Int16Array": {
"spec": "http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects",