Skip to content

Commit 8ad66bb

Browse files
committed
Compiler test case for commit 0636a06
1 parent e2071a3 commit 8ad66bb

5 files changed

+324
-0
lines changed

tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js.map

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
===================================================================
2+
JsFile: fooResult.js
3+
mapUrl: fooResult.js.map
4+
sourceRoot:
5+
sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts
6+
===================================================================
7+
-------------------------------------------------------------------
8+
emittedFile:fooResult.js
9+
sourceFile:tests/cases/compiler/a.ts
10+
-------------------------------------------------------------------
11+
>>>var M;
12+
1 >
13+
2 >^^^^
14+
3 > ^
15+
4 > ^
16+
5 > ^^^^^^^^^^->
17+
1 >
18+
2 >module
19+
3 > M
20+
4 > {
21+
> export var X = 1;
22+
> }
23+
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
24+
2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0)
25+
3 >Emitted(1, 6) Source(1, 9) + SourceIndex(0)
26+
4 >Emitted(1, 7) Source(3, 2) + SourceIndex(0)
27+
---
28+
>>>(function (M) {
29+
1->
30+
2 >^^^^^^^^^^^
31+
3 > ^
32+
4 > ^^
33+
5 > ^
34+
1->
35+
2 >module
36+
3 > M
37+
4 >
38+
5 > {
39+
1->Emitted(2, 1) Source(1, 1) + SourceIndex(0)
40+
2 >Emitted(2, 12) Source(1, 8) + SourceIndex(0)
41+
3 >Emitted(2, 13) Source(1, 9) + SourceIndex(0)
42+
4 >Emitted(2, 15) Source(1, 10) + SourceIndex(0)
43+
5 >Emitted(2, 16) Source(1, 11) + SourceIndex(0)
44+
---
45+
>>> M.X = 1;
46+
1 >^^^^
47+
2 > ^^^
48+
3 > ^^^
49+
4 > ^
50+
5 > ^
51+
6 > ^^^^^^^->
52+
1 >
53+
> export var
54+
2 > X
55+
3 > =
56+
4 > 1
57+
5 > ;
58+
1 >Emitted(3, 5) Source(2, 16) + SourceIndex(0) name (M)
59+
2 >Emitted(3, 8) Source(2, 17) + SourceIndex(0) name (M)
60+
3 >Emitted(3, 11) Source(2, 20) + SourceIndex(0) name (M)
61+
4 >Emitted(3, 12) Source(2, 21) + SourceIndex(0) name (M)
62+
5 >Emitted(3, 13) Source(2, 22) + SourceIndex(0) name (M)
63+
---
64+
>>>})(M || (M = {}));
65+
1->
66+
2 >^
67+
3 > ^^
68+
4 > ^
69+
5 > ^^^^^
70+
6 > ^
71+
7 > ^^^^^^^^
72+
1->
73+
>
74+
2 >}
75+
3 >
76+
4 > M
77+
5 >
78+
6 > M
79+
7 > {
80+
> export var X = 1;
81+
> }
82+
1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) name (M)
83+
2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) name (M)
84+
3 >Emitted(4, 4) Source(1, 8) + SourceIndex(0)
85+
4 >Emitted(4, 5) Source(1, 9) + SourceIndex(0)
86+
5 >Emitted(4, 10) Source(1, 8) + SourceIndex(0)
87+
6 >Emitted(4, 11) Source(1, 9) + SourceIndex(0)
88+
7 >Emitted(4, 19) Source(3, 2) + SourceIndex(0)
89+
---
90+
-------------------------------------------------------------------
91+
emittedFile:fooResult.js
92+
sourceFile:tests/cases/compiler/b.ts
93+
-------------------------------------------------------------------
94+
>>>var m1;
95+
1 >
96+
2 >^^^^
97+
3 > ^^
98+
4 > ^
99+
5 > ^^^^^^^^^^->
100+
1 >
101+
2 >module
102+
3 > m1
103+
4 > {
104+
> export class c1 {
105+
> }
106+
> }
107+
1 >Emitted(5, 1) Source(1, 1) + SourceIndex(1)
108+
2 >Emitted(5, 5) Source(1, 8) + SourceIndex(1)
109+
3 >Emitted(5, 7) Source(1, 10) + SourceIndex(1)
110+
4 >Emitted(5, 8) Source(4, 2) + SourceIndex(1)
111+
---
112+
>>>(function (m1) {
113+
1->
114+
2 >^^^^^^^^^^^
115+
3 > ^^
116+
4 > ^^
117+
5 > ^
118+
6 > ^^^^^^^^^^^^->
119+
1->
120+
2 >module
121+
3 > m1
122+
4 >
123+
5 > {
124+
1->Emitted(6, 1) Source(1, 1) + SourceIndex(1)
125+
2 >Emitted(6, 12) Source(1, 8) + SourceIndex(1)
126+
3 >Emitted(6, 14) Source(1, 10) + SourceIndex(1)
127+
4 >Emitted(6, 16) Source(1, 11) + SourceIndex(1)
128+
5 >Emitted(6, 17) Source(1, 12) + SourceIndex(1)
129+
---
130+
>>> var c1 = (function () {
131+
1->^^^^
132+
2 > ^^^^
133+
3 > ^^
134+
4 > ^^^^^^^^^^^^^^->
135+
1->
136+
>
137+
2 > export class
138+
3 > c1
139+
1->Emitted(7, 5) Source(2, 5) + SourceIndex(1) name (m1)
140+
2 >Emitted(7, 9) Source(2, 18) + SourceIndex(1) name (m1)
141+
3 >Emitted(7, 11) Source(2, 20) + SourceIndex(1) name (m1)
142+
---
143+
>>> function c1() {
144+
1->^^^^^^^^
145+
2 > ^^^^^^^^^
146+
3 > ^^
147+
1->
148+
2 > export class
149+
3 > c1
150+
1->Emitted(8, 9) Source(2, 5) + SourceIndex(1) name (m1.c1)
151+
2 >Emitted(8, 18) Source(2, 18) + SourceIndex(1) name (m1.c1)
152+
3 >Emitted(8, 20) Source(2, 20) + SourceIndex(1) name (m1.c1)
153+
---
154+
>>> }
155+
1 >^^^^^^^^
156+
2 > ^
157+
3 > ^^^^^^^^^^->
158+
1 > {
159+
>
160+
2 > }
161+
1 >Emitted(9, 9) Source(3, 5) + SourceIndex(1) name (m1.c1.constructor)
162+
2 >Emitted(9, 10) Source(3, 6) + SourceIndex(1) name (m1.c1.constructor)
163+
---
164+
>>> return c1;
165+
1->^^^^^^^^
166+
2 > ^^^^^^^^^
167+
1->
168+
2 > }
169+
1->Emitted(10, 9) Source(3, 5) + SourceIndex(1) name (m1.c1)
170+
2 >Emitted(10, 18) Source(3, 6) + SourceIndex(1) name (m1.c1)
171+
---
172+
>>> })();
173+
1 >^^^^
174+
2 > ^
175+
3 >
176+
4 > ^^^^
177+
5 > ^^^^^^^->
178+
1 >
179+
2 > }
180+
3 >
181+
4 > export class c1 {
182+
> }
183+
1 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) name (m1.c1)
184+
2 >Emitted(11, 6) Source(3, 6) + SourceIndex(1) name (m1.c1)
185+
3 >Emitted(11, 6) Source(2, 5) + SourceIndex(1) name (m1)
186+
4 >Emitted(11, 10) Source(3, 6) + SourceIndex(1) name (m1)
187+
---
188+
>>> m1.c1 = c1;
189+
1->^^^^
190+
2 > ^^^^^
191+
3 > ^^^
192+
4 > ^^
193+
5 > ^
194+
6 > ^^^^^^->
195+
1->
196+
2 > c1
197+
3 >
198+
4 > c1 {
199+
> }
200+
5 >
201+
1->Emitted(12, 5) Source(2, 18) + SourceIndex(1) name (m1)
202+
2 >Emitted(12, 10) Source(2, 20) + SourceIndex(1) name (m1)
203+
3 >Emitted(12, 13) Source(2, 18) + SourceIndex(1) name (m1)
204+
4 >Emitted(12, 15) Source(3, 6) + SourceIndex(1) name (m1)
205+
5 >Emitted(12, 16) Source(3, 6) + SourceIndex(1) name (m1)
206+
---
207+
>>>})(m1 || (m1 = {}));
208+
1->
209+
2 >^
210+
3 > ^^
211+
4 > ^^
212+
5 > ^^^^^
213+
6 > ^^
214+
7 > ^^^^^^^^
215+
8 > ^^^^^^^^^^^^^^^^->
216+
1->
217+
>
218+
2 >}
219+
3 >
220+
4 > m1
221+
5 >
222+
6 > m1
223+
7 > {
224+
> export class c1 {
225+
> }
226+
> }
227+
1->Emitted(13, 1) Source(4, 1) + SourceIndex(1) name (m1)
228+
2 >Emitted(13, 2) Source(4, 2) + SourceIndex(1) name (m1)
229+
3 >Emitted(13, 4) Source(1, 8) + SourceIndex(1)
230+
4 >Emitted(13, 6) Source(1, 10) + SourceIndex(1)
231+
5 >Emitted(13, 11) Source(1, 8) + SourceIndex(1)
232+
6 >Emitted(13, 13) Source(1, 10) + SourceIndex(1)
233+
7 >Emitted(13, 21) Source(4, 2) + SourceIndex(1)
234+
---
235+
>>>//# sourceMappingURL=fooResult.js.map
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
=== tests/cases/compiler/a.ts ===
2+
module M {
3+
>M : typeof M
4+
5+
export var X = 1;
6+
>X : number
7+
}
8+
interface Navigator {
9+
>Navigator : Navigator
10+
11+
getGamepads(func?: any): any;
12+
>getGamepads : (func?: any) => any
13+
>func : any
14+
15+
webkitGetGamepads(func?: any): any
16+
>webkitGetGamepads : (func?: any) => any
17+
>func : any
18+
19+
msGetGamepads(func?: any): any;
20+
>msGetGamepads : (func?: any) => any
21+
>func : any
22+
23+
webkitGamepads(func?: any): any;
24+
>webkitGamepads : (func?: any) => any
25+
>func : any
26+
}
27+
28+
=== tests/cases/compiler/b.ts ===
29+
module m1 {
30+
>m1 : typeof m1
31+
32+
export class c1 {
33+
>c1 : c1
34+
}
35+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// @out: fooResult.js
2+
// @sourcemap: true
3+
// @Filename: a.ts
4+
module M {
5+
export var X = 1;
6+
}
7+
interface Navigator {
8+
getGamepads(func?: any): any;
9+
webkitGetGamepads(func?: any): any
10+
msGetGamepads(func?: any): any;
11+
webkitGamepads(func?: any): any;
12+
}
13+
14+
// @Filename: b.ts
15+
module m1 {
16+
export class c1 {
17+
}
18+
}

0 commit comments

Comments
 (0)