-
-
Notifications
You must be signed in to change notification settings - Fork 898
Expand file tree
/
Copy pathparser_babel.snap
More file actions
14811 lines (12753 loc) · 568 KB
/
parser_babel.snap
File metadata and controls
14811 lines (12753 loc) · 568 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
commit: 87a048db
parser_babel Summary:
AST Parsed : 2232/2232 (100.00%)
Positive Passed: 2218/2232 (99.37%)
Negative Passed: 1688/1704 (99.06%)
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-type-assertion-and-assign/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/conditional/arrow-ambiguity/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/conditional/arrow-like/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/conditional/arrow-param/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/module-function/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/namespace-function/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/decorators/type-arguments-invalid/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/dts/invalid-class-implementation/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/export/equals-in-script/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/equals-in-script/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/equals-require-in-script/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/module-namespace/module-identifier-invalid/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-2/input.ts
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-invalid/input.ts
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/estree/class-private-method/typescript-invalid-abstract/input.ts
× TS(18019): 'abstract' modifier cannot be used with a private identifier.
╭─[babel/packages/babel-parser/test/fixtures/estree/class-private-method/typescript-invalid-abstract/input.ts:2:12]
1 │ abstract class TSAbstractClass {
2 │ abstract #foo(name: string): boolean;
· ────
3 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/constructor-with-modifier-names/input.ts
× Multiple constructor implementations are not allowed.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/constructor-with-modifier-names/input.ts:2:3]
1 │ class Foo {
2 │ constructor(set, readonly) {}
· ─────┬─────
· ╰── constructor has already been declared here
3 │ constructor(set: any, readonly: boolean) {}
· ─────┬─────
· ╰── it cannot be redeclared here
4 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/declare/input.ts
× Identifier `x` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/declare/input.ts:3:5]
2 │ [x: string]: any;
3 │ x;
· ┬
· ╰── `x` has already been declared here
4 │ x: number;
· ┬
· ╰── It can not be redeclared here
5 │ f();
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts:2:5]
1 │ class C {
2 │ public(): void;
· ──────
3 │ public static(): void;
╰────
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts:3:12]
2 │ public(): void;
3 │ public static(): void;
· ──────
4 │ readonly = 0;
╰────
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/input.ts:5:5]
4 │ readonly = 0;
5 │ async<T>(): void;
· ─────
6 │ abstract!:void;
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/input.ts
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/input.ts:2:12]
1 │ class C {
2 │ public delete(): void;
· ──────
3 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/method-no-body/input.ts
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/method-no-body/input.ts:3:5]
2 │ f();
3 │ f(): void;
· ─
4 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/input.ts
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/input.ts:3:5]
2 │ {
3 │ m()
· ─
4 │ n()
╰────
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/input.ts:4:5]
3 │ m()
4 │ n()
· ─
5 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts
× TS(1183): An implementation cannot be declared in ambient contexts.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts:17:19]
16 │ declare class DeclaredClass extends BaseClass {
17 │ override test() {}
· ▲
18 │ }
╰────
× Identifier `show` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts:2:12]
1 │ class MyClass extends BaseClass {
2 │ override show() {}
· ──┬─
· ╰── `show` has already been declared here
3 │ public override show() {}
· ──┬─
· ╰── It can not be redeclared here
4 │ override size = 5;
╰────
× Identifier `size` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts:4:12]
3 │ public override show() {}
4 │ override size = 5;
· ──┬─
· ╰── `size` has already been declared here
5 │ override readonly size = 5;
· ──┬─
· ╰── It can not be redeclared here
6 │
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/input.ts
× TS(1015): A parameter cannot have a question mark and an initializer.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/input.ts:10:16]
9 │ readonly x = 0,
10 │ public y?: number = 0) {}
· ─
11 │ }
╰────
× TS(1016): A required parameter cannot follow an optional parameter.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/input.ts:7:9]
6 │ private pi?: number,
7 │ public readonly pur,
· ───────────────────
8 │ // Also works on AssignmentPattern
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/properties/input.ts
× Identifier `x` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/properties/input.ts:2:5]
1 │ class C {
2 │ x;
· ┬
· ╰── `x` has already been declared here
3 │ x?;
· ┬
· ╰── It can not be redeclared here
4 │ x: number;
╰────
× Identifier `x` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/properties/input.ts:3:5]
2 │ x;
3 │ x?;
· ┬
· ╰── `x` has already been declared here
4 │ x: number;
· ┬
· ╰── It can not be redeclared here
5 │ x: number = 1;
╰────
× Identifier `x` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/properties/input.ts:4:5]
3 │ x?;
4 │ x: number;
· ┬
· ╰── `x` has already been declared here
5 │ x: number = 1;
· ┬
· ╰── It can not be redeclared here
6 │ x!;
╰────
× Identifier `x` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/properties/input.ts:5:5]
4 │ x: number;
5 │ x: number = 1;
· ┬
· ╰── `x` has already been declared here
6 │ x!;
· ┬
· ╰── It can not be redeclared here
7 │ x!: number;
╰────
× Identifier `x` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/properties/input.ts:6:5]
5 │ x: number = 1;
6 │ x!;
· ┬
· ╰── `x` has already been declared here
7 │ x!: number;
· ┬
· ╰── It can not be redeclared here
8 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/static/input.ts
× TS(2391): Function implementation is missing or not immediately following the declaration.
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/static/input.ts:5:20]
4 │ protected static f();
5 │ private static f();
· ─
6 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/function/declare-pattern-parameters/input.ts
× TS(1016): A required parameter cannot follow an optional parameter.
╭─[babel/packages/babel-parser/test/fixtures/typescript/function/declare-pattern-parameters/input.ts:1:25]
1 │ declare function f([]?, {})
· ──
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts
× Identifier `method` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts:29:3]
28 │ class _ {
29 │ method<const T>() {}
· ───┬──
· ╰── `method` has already been declared here
30 │ method<const T extends U>() {}
· ───┬──
· ╰── It can not be redeclared here
31 │ method<T, const U>() {}
╰────
× Identifier `method` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/types/const-type-parameters/input.ts:30:3]
29 │ method<const T>() {}
30 │ method<const T extends U>() {}
· ───┬──
· ╰── `method` has already been declared here
31 │ method<T, const U>() {}
· ───┬──
· ╰── It can not be redeclared here
32 │ }
╰────
Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/types/literal-string-4/input.ts
× TS(1338): 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
╭─[babel/packages/babel-parser/test/fixtures/typescript/types/literal-string-4/input.ts:1:15]
1 │ let x: `foo-${infer bar}`;
· ─────────
╰────
× Invalid function declaration
╭─[babel/packages/babel-parser/test/fixtures/annex-b/enabled/3.1-sloppy-labeled-functions-if-body/input.js:1:11]
1 │ if (0) x: function f() {}
· ───────────────
╰────
help: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement
× Identifier `f` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/annex-b/enabled/3.4-var-redeclaration-catch-binding/input.js:2:17]
1 │ try {} catch (e) { var e; }
2 │ try {} catch ({ f }) { var f; }
· ┬ ┬
· │ ╰── It can not be redeclared here
· ╰── `f` has already been declared here
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/annex-b/enabled/invalid-assignment-target-type/input.js:3:2]
2 │
3 │ [async()] = [];
· ───────
4 │ ({ a: async() } = {});
╰────
× Expected `;` but found `Identifier`
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/input.js:3:3]
2 │ var a = 1
3 │ a < 3
· ┬
· ╰── `;` expected
4 │ a++
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/input.js:1:2]
1 │ (a = 1) = t
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/input.js:1:3]
1 │ [(a = 1)] = t
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/input.js:1:2]
1 │ [({ a: [b = 2]})] = t
· ───────────────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/input.js:1:7]
1 │ [{b: [([a = 1])]}] = t
· ─────────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/input.js:1:2]
1 │ [([x])] = t;
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-6/input.js:1:2]
1 │ (a += 1) = t
· ──────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-7/input.js:1:2]
1 │ (a -= 1) = t
· ──────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-8/input.js:1:2]
1 │ (b = (a -= 1)) = t
· ────────────
╰────
× Invalid function declaration
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/input.js:1:11]
1 │ while (1) function foo(){}
· ────────────────
╰────
help: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement
× Invalid function declaration
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-if/input.js:1:18]
1 │ if (1) foo: bar: function foo(){}
· ────────────────
╰────
help: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement
× Invalid function declaration
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/input.js:1:21]
1 │ while (1) foo: bar: function foo(){}
· ────────────────
╰────
help: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-left-hand-side-in-postfix-operation/input.js:1:1]
1 │ a++ = t
· ───
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/invalid-left-hand-side-in-prefix-operation/input.js:1:1]
1 │ ++a = t
· ───
╰────
× Expected switch clause
╭─[babel/packages/babel-parser/test/fixtures/core/categorized/malformed-switch/input.js:2:3]
1 │ switch (x) {
2 │ var y = 5;
· ─┬─
· ╰── `case` or `default` clause expected here
3 │ }
╰────
help: If this is intended to be the condition for the switch statement, add `case` before it.
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/input.js:1:1]
1 │ ({x}) = {x: 1};
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/input.js:1:7]
1 │ [{b: [([a = 1])]}] = t
· ─────────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/input.js:1:2]
1 │ [({ a: [b = 2]})] = t
· ───────────────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/input.js:1:3]
1 │ [(a = 1)] = t
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/input.js:1:2]
1 │ (a = 1) = t
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/input.js:1:1]
1 │ ([a]) = []
· ─────
╰────
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/input.js:1:2]
1 │ (!a) += 1
· ──
╰────
× Expected a semicolon or an implicit semicolon after a statement, but found none
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/input.js:1:11]
1 │ ([...(a)]) => {}
· ▲
╰────
help: Try inserting a semicolon here
× Cannot assign to this expression
╭─[babel/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/input.js:1:2]
1 │ [([x])] = t;
· ─────
╰────
× Expected `:` but found `}`
╭─[babel/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/input.js:3:1]
2 │ br\u{65}ak
3 │ };
· ┬
· ╰── `:` expected
╰────
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/input.js:1:1]
1 │ "\01 foo \02 bar \03";
· ─────────────────────
2 │
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/input.js:3:1]
2 │
3 │ "\4";
· ────
4 │ "\5";
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/input.js:4:1]
3 │ "\4";
4 │ "\5";
· ────
5 │
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/input.js:8:1]
7 │
8 │ "\4";
· ────
9 │ "\5";
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/input.js:9:1]
8 │ "\4";
9 │ "\5";
· ────
10 │
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/input.js:11:1]
10 │
11 │ "\04 foo \05 bar \06";
· ─────────────────────
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/input.js:2:3]
1 │ function a() {
2 │ "\5";
· ────
3 │ "use strict";
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/input.js:7:3]
6 │ function b() {
7 │ "\4";
· ────
8 │ "\5";
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/input.js:8:3]
7 │ "\4";
8 │ "\5";
· ────
9 │ "use strict";
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/input.js:14:3]
13 │ "use strict";
14 │ "\5";
· ────
15 │ }
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/input.js:19:3]
18 │ "use strict";
19 │ "\4";
· ────
20 │ "\5";
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/input.js:20:3]
19 │ "\4";
20 │ "\5";
· ────
21 │ }
╰────
help: for octal literals use the '0o' prefix instead
× Invalid escape sequence
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/input.js:4:3]
3 │ "use strict";
4 │ "\8";"\9";
· ────
5 │ }
╰────
help: \8 and \9 are not allowed in strict mode
× Invalid escape sequence
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/input.js:4:8]
3 │ "use strict";
4 │ "\8";"\9";
· ────
5 │ }
╰────
help: \8 and \9 are not allowed in strict mode
× Invalid escape sequence
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/input.js:2:3]
1 │ () => {
2 │ "\8";"\9";
· ────
3 │ "use strict";
╰────
help: \8 and \9 are not allowed in strict mode
× Invalid escape sequence
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/input.js:2:8]
1 │ () => {
2 │ "\8";"\9";
· ────
3 │ "use strict";
╰────
help: \8 and \9 are not allowed in strict mode
× Invalid escape sequence
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/input.js:4:3]
3 │ "use strict";
4 │ "\8";"\9";
· ────
5 │ }
╰────
help: \8 and \9 are not allowed in strict mode
× Invalid escape sequence
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/input.js:4:8]
3 │ "use strict";
4 │ "\8";"\9";
· ────
5 │ }
╰────
help: \8 and \9 are not allowed in strict mode
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/input.js:1:53]
1 │ function hello() { "use strict"; function inner() { "octal directive\1"; } }
· ───────────────────
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/input.js:1:37]
1 │ function hello() { 'use strict'; ({ "\1": 42 }); }
· ────
╰────
help: for octal literals use the '0o' prefix instead
× Bad escape sequence in untagged template literal
╭─[babel/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/input.js:1:2]
1 │ `\8`;
· ──
╰────
× Bad escape sequence in untagged template literal
╭─[babel/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/input.js:1:2]
1 │ `\9`;
· ──
╰────
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/input.js:1:15]
1 │ "use strict"; 04; 05;
· ──
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/input.js:1:19]
1 │ "use strict"; 04; 05;
· ──
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/input.js:3:3]
2 │ "use strict";
3 │ 05;
· ──
4 │ }
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/input.js:8:3]
7 │ "use strict";
8 │ 04;
· ──
9 │ 05;
╰────
help: for octal literals use the '0o' prefix instead
× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[babel/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/input.js:9:3]
8 │ 04;
9 │ 05;
· ──
10 │ }
╰────
help: for octal literals use the '0o' prefix instead
× Keywords cannot contain escape characters
╭─[babel/packages/babel-parser/test/fixtures/core/object/invalid-escape-get/input.js:1:4]
1 │ ({ ge\u0074 x() {} })
· ────────
╰────
× A 'get' accessor must not have any formal parameters.
╭─[babel/packages/babel-parser/test/fixtures/core/object/invalid-getter-param/input.js:1:12]
1 │ ({ get prop(x) {} })
· ───
╰────
help: Remove these parameters here
× TS(1049): A 'set' accessor must have exactly one parameter.
╭─[babel/packages/babel-parser/test/fixtures/core/object/invalid-setter-no-param/input.js:1:9]
1 │ ({ set x(){} })
· ──
╰────
help: Add a parameter here
× TS(1049): A 'set' accessor must have exactly one parameter.
╭─[babel/packages/babel-parser/test/fixtures/core/object/invalid-setter-two-params/input.js:1:12]
1 │ ({ set prop(x, y) {} })
· ──────
╰────
help: Remove parameters except the first one here
× `await` is only allowed within async functions and at the top levels of modules
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowAwaitOutsideFunction-false/input.js:1:5]
1 │ for await (const i of imports) {}
· ─────
╰────
help: Either remove this `await` or add the `async` keyword to the enclosing function
× Unexpected new.target expression
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowNewTargetOutsideFunction-false/input.js:1:11]
1 │ const x = new.target;
· ──────────
╰────
help: new.target is only allowed in constructors, functions, and class field initializers
× Unexpected new.target expression
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowNewTargetOutsideFunction-false-2/input.js:1:17]
1 │ const y = () => new.target;
· ──────────
╰────
help: new.target is only allowed in constructors, functions, and class field initializers
× TS(1108): A 'return' statement can only be used within a function body.
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowReturnOutsideFunction-true-invalid-in-static-block/input.js:3:5]
2 │ static {
3 │ return 0;
· ──────
4 │ }
╰────
× A 'yield' expression is only allowed in a generator body.
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowYieldOutsideFunction-false/input.js:1:1]
1 │ yield 1;
· ─────
╰────
help: Either remove this `yield` or change the enclosing function to a generator function (`function*`)
× A 'yield' expression is only allowed in a generator body.
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowYieldOutsideFunction-true/input.js:1:1]
1 │ yield 1;
· ─────
2 │
╰────
help: Either remove this `yield` or change the enclosing function to a generator function (`function*`)
× A 'yield' expression is only allowed in a generator body.
╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowYieldOutsideFunction-true/input.js:4:3]
3 │ function fn() {
4 │ yield 1;
· ─────
5 │ }
╰────
help: Either remove this `yield` or change the enclosing function to a generator function (`function*`)
× Unexpected token
╭─[babel/packages/babel-parser/test/fixtures/core/regression/13694-invalid-dot-bracketL-member/input.js:1:3]
1 │ a.[b]
· ─
╰────
× Unexpected token
╭─[babel/packages/babel-parser/test/fixtures/core/regression/T2921/input.js:1:5]
1 │ a <== b;
· ─
╰────
× Decimals with leading zeros are not allowed in strict mode
╭─[babel/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/input.js:1:1]
1 │ 09.5
· ────
╰────
help: remove the leading zero
× Expected a semicolon or an implicit semicolon after a statement, but found none
╭─[babel/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/input.js:1:3]
1 │ 07.5
· ▲
╰────
help: Try inserting a semicolon here
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/input.js:2:5]
1 │ let bar;
2 │ var foo = 1;
· ─┬─
· ╰── `foo` has already been declared here
3 │ let foo = 1;
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/input.js:3:7]
2 │ let bar;
3 │ var foo = 1;
· ─┬─
· ╰── `foo` has already been declared here
4 │ let foo = 1;
· ─┬─
· ╰── It can not be redeclared here
5 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/input.js:2:5]
1 │ let bar;
2 │ let foo = 1;
· ─┬─
· ╰── `foo` has already been declared here
3 │ var foo = 1;
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/input.js:3:7]
2 │ let bar;
3 │ let foo = 1;
· ─┬─
· ╰── `foo` has already been declared here
4 │ var foo = 1;
· ─┬─
· ╰── It can not be redeclared here
5 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/input.js:2:11]
1 │ try {
2 │ } catch ([foo, foo]) {
· ─┬─ ─┬─
· │ ╰── It can not be redeclared here
· ╰── `foo` has already been declared here
3 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/input.js:1:5]
1 │ let foo; try {} catch (foo) {} let foo;
· ─┬─ ─┬─
· │ ╰── It can not be redeclared here
· ╰── `foo` has already been declared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/input.js:2:10]
1 │ try {
2 │ } catch (foo) {
· ─┬─
· ╰── `foo` has already been declared here
3 │ function foo() {}
· ─┬─
· ╰── It can not be redeclared here
4 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/input.js:2:10]
1 │ try {
2 │ } catch (foo) {
· ─┬─
· ╰── `foo` has already been declared here
3 │ let foo;
· ─┬─
· ╰── It can not be redeclared here
4 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/input.js:2:15]
1 │ try {
2 │ } catch ({ a: foo, b: { c: [foo] } }) {
· ─┬─ ─┬─
· │ ╰── It can not be redeclared here
· ╰── `foo` has already been declared here
3 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/input.js:2:11]
1 │ try {
2 │ } catch ([foo]) {
· ─┬─
· ╰── `foo` has already been declared here
3 │ var foo;
· ─┬─
· ╰── It can not be redeclared here
4 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/input.js:2:12]
1 │ try {
2 │ } catch ({ foo }) {
· ─┬─
· ╰── `foo` has already been declared here
3 │ var foo;
· ─┬─
· ╰── It can not be redeclared here
4 │ }
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/input.js:1:7]
1 │ class foo {};
· ─┬─
· ╰── `foo` has already been declared here
2 │ class foo {};
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/input.js:1:7]
1 │ class foo {};
· ─┬─
· ╰── `foo` has already been declared here
2 │ const foo = 1;
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/input.js:1:7]
1 │ class foo {};
· ─┬─
· ╰── `foo` has already been declared here
2 │ function foo () {};
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/input.js:1:7]
1 │ class foo {};
· ─┬─
· ╰── `foo` has already been declared here
2 │ let foo = 1;
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/input.js:1:7]
1 │ class foo {};
· ─┬─
· ╰── `foo` has already been declared here
2 │ var foo;
· ─┬─
· ╰── It can not be redeclared here
╰────
× Identifier `foo` has already been declared