-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix source maps for template literals (#16515)
* Add test * Fix source maps for template literals
- Loading branch information
1 parent
d6c2343
commit fbfe16c
Showing
10 changed files
with
54 additions
and
20 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/babel-core/test/fixtures/transformation/source-maps/template-literal/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let a = `a${b}c`; |
3 changes: 3 additions & 0 deletions
3
packages/babel-core/test/fixtures/transformation/source-maps/template-literal/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"sourceMaps": true | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-core/test/fixtures/transformation/source-maps/template-literal/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let a = `a${b}c`; |
20 changes: 20 additions & 0 deletions
20
...abel-core/test/fixtures/transformation/source-maps/template-literal/source-map-visual.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(1:0-4) let a = <-- (1:0-4) let a = | ||
^^^^ ^^^^ | ||
|
||
(1:4-5) let a = ` <-- (1:4-5) let a = ` | ||
^ ^ | ||
|
||
(1:5-8) et a = `a${ <-- (1:5-8) et a = `a${ | ||
^^^ ^^^ | ||
|
||
(1:8-12) a = `a${b}c` <-- (1:8-12) a = `a${b}c` | ||
^^^^ ^^^^ | ||
|
||
(1:12-13) `a${b}c`; <-- (1:12-13) `a${b}c`; | ||
^ ^ | ||
|
||
(1:13-16) a${b}c`; <-- (1:13-16) a${b}c`; | ||
^^^ ^^^ | ||
|
||
(1:16-17) b}c`; <-- (1:16-17) b}c`; | ||
^ ^ |
15 changes: 15 additions & 0 deletions
15
...ages/babel-core/test/fixtures/transformation/source-maps/template-literal/source-map.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": 3, | ||
"names": [ | ||
"a", | ||
"b" | ||
], | ||
"sources": [ | ||
"source-maps/template-literal/input.js" | ||
], | ||
"sourcesContent": [ | ||
"let a = `a${b}c`;" | ||
], | ||
"mappings": "AAAA,IAAIA,CAAC,GAAG,IAAIC,CAAC,GAAG", | ||
"ignoreList": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/source-map.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters