Skip to content

Commit a4fb050

Browse files
Merge pull request #18638 from Microsoft/addTestRegex
Adds regression test for parsing bug
2 parents 1821735 + 6a34dc9 commit a4fb050

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//// [parserNotRegex2.ts]
2+
declare const A: any;
3+
declare const B: any;
4+
declare const C: any;
5+
const x = (A / 2);
6+
B(
7+
C(),
8+
() => { },
9+
() => { }
10+
);
11+
12+
13+
//// [parserNotRegex2.js]
14+
var x = (A / 2);
15+
B(C(), function () { }, function () { });
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
=== tests/cases/conformance/parser/ecmascript5/parserNotRegex2.ts ===
2+
declare const A: any;
3+
>A : Symbol(A, Decl(parserNotRegex2.ts, 0, 13))
4+
5+
declare const B: any;
6+
>B : Symbol(B, Decl(parserNotRegex2.ts, 1, 13))
7+
8+
declare const C: any;
9+
>C : Symbol(C, Decl(parserNotRegex2.ts, 2, 13))
10+
11+
const x = (A / 2);
12+
>x : Symbol(x, Decl(parserNotRegex2.ts, 3, 5))
13+
>A : Symbol(A, Decl(parserNotRegex2.ts, 0, 13))
14+
15+
B(
16+
>B : Symbol(B, Decl(parserNotRegex2.ts, 1, 13))
17+
18+
C(),
19+
>C : Symbol(C, Decl(parserNotRegex2.ts, 2, 13))
20+
21+
() => { },
22+
() => { }
23+
);
24+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
=== tests/cases/conformance/parser/ecmascript5/parserNotRegex2.ts ===
2+
declare const A: any;
3+
>A : any
4+
5+
declare const B: any;
6+
>B : any
7+
8+
declare const C: any;
9+
>C : any
10+
11+
const x = (A / 2);
12+
>x : number
13+
>(A / 2) : number
14+
>A / 2 : number
15+
>A : any
16+
>2 : 2
17+
18+
B(
19+
>B( C(), () => { }, () => { }) : any
20+
>B : any
21+
22+
C(),
23+
>C() : any
24+
>C : any
25+
26+
() => { },
27+
>() => { } : () => void
28+
29+
() => { }
30+
>() => { } : () => void
31+
32+
);
33+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare const A: any;
2+
declare const B: any;
3+
declare const C: any;
4+
const x = (A / 2);
5+
B(
6+
C(),
7+
() => { },
8+
() => { }
9+
);

0 commit comments

Comments
 (0)