Skip to content

Commit 0ed72d9

Browse files
committed
Add test for template literals with source map
1 parent a612cc3 commit 0ed72d9

File tree

6 files changed

+74
-0
lines changed

6 files changed

+74
-0
lines changed

tests/baselines/reference/templateLiteralsSourceMap.js

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

tests/baselines/reference/templateLiteralsSourceMap.js.map

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
===================================================================
2+
JsFile: templateLiteralsSourceMap.js
3+
mapUrl: templateLiteralsSourceMap.js.map
4+
sourceRoot:
5+
sources: templateLiteralsSourceMap.ts
6+
===================================================================
7+
-------------------------------------------------------------------
8+
emittedFile:tests/cases/compiler/templateLiteralsSourceMap.js
9+
sourceFile:templateLiteralsSourceMap.ts
10+
-------------------------------------------------------------------
11+
>>>var s = "a".concat(0, "b").concat(1, "c").concat(2);
12+
1 >
13+
2 >^^^^
14+
3 > ^
15+
4 > ^^^
16+
5 > ^^^^^^^^^^^
17+
6 > ^
18+
7 > ^^^^^^^^^^^^^^
19+
8 > ^
20+
9 > ^^^^^^^^^^^^^^
21+
10> ^
22+
11> ^
23+
12> ^
24+
1 >
25+
2 >const
26+
3 > s
27+
4 > =
28+
5 > `a${
29+
6 > 0
30+
7 > }b${
31+
8 > 1
32+
9 > }c${
33+
10> 2
34+
11> }`
35+
12> ;
36+
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
37+
2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0)
38+
3 >Emitted(1, 6) Source(1, 8) + SourceIndex(0)
39+
4 >Emitted(1, 9) Source(1, 11) + SourceIndex(0)
40+
5 >Emitted(1, 20) Source(1, 15) + SourceIndex(0)
41+
6 >Emitted(1, 21) Source(1, 16) + SourceIndex(0)
42+
7 >Emitted(1, 35) Source(1, 20) + SourceIndex(0)
43+
8 >Emitted(1, 36) Source(1, 21) + SourceIndex(0)
44+
9 >Emitted(1, 50) Source(1, 25) + SourceIndex(0)
45+
10>Emitted(1, 51) Source(1, 26) + SourceIndex(0)
46+
11>Emitted(1, 52) Source(1, 28) + SourceIndex(0)
47+
12>Emitted(1, 53) Source(1, 29) + SourceIndex(0)
48+
---
49+
>>>//# sourceMappingURL=templateLiteralsSourceMap.js.map
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== tests/cases/compiler/templateLiteralsSourceMap.ts ===
2+
const s = `a${0}b${1}c${2}`;
3+
>s : Symbol(s, Decl(templateLiteralsSourceMap.ts, 0, 5))
4+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=== tests/cases/compiler/templateLiteralsSourceMap.ts ===
2+
const s = `a${0}b${1}c${2}`;
3+
>s : string
4+
>`a${0}b${1}c${2}` : string
5+
>0 : 0
6+
>1 : 1
7+
>2 : 2
8+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @sourcemap: true
2+
3+
const s = `a${0}b${1}c${2}`;

0 commit comments

Comments
 (0)