-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle source map referencing EOL character (#136)
- Detect EOL character for the file. It fixes wrong splitting for source maps generated on Windows environments. - When checking column boundary verify that the last referenced column is not EOL. - Generate source map referencing EOL characters (typescript.ts) - Fix 'InvalidMappingLine' check. Getting not existing value from array returns `undefined`, not `null`. - Add test for 'InvalidMappingColumn' error. Generate `invalid-map-column.js` and `invalid-map-line.js`. - Fix tests for errors - Use `/` as invalid filename - works on Linux/Windows
- Loading branch information
1 parent
2f8535b
commit 254a5d9
Showing
10 changed files
with
500 additions
and
402 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# How to generate | ||
|
||
## `invalid-map-column.js` | ||
|
||
1. Create `src/invalid-map-column.ts` with content | ||
``` | ||
console.log('goodbye cruel world'); | ||
console.log('goodbye man'); | ||
``` | ||
2. Run `tsc --inlineSourceMap src/invalid-map-column.ts --outFile ../data/invalid-map-column.js` | ||
3. Save source map comment from `../data/invalid-map-column.js` | ||
4. Replace `src/invalid-map-column.ts` content with | ||
``` | ||
console.log('hello happy world'); | ||
console.log('hello man'); | ||
``` | ||
5. Run `.2` again | ||
6. Replace source map comment of `../data/invalid-map-column.js` with one from `.3` | ||
|
||
## `invalid-map-line.js` | ||
|
||
1. Create `src/invalid-map-line.ts` with content | ||
``` | ||
console.log('hello happy world'); | ||
console.log('hello man'); | ||
``` | ||
2. Run `tsc --inlineSourceMap src/invalid-map-line.ts --outFile ../data/invalid-map-line.js` | ||
3. Save source map comment from `../data/invalid-map-line.js` | ||
4. Replace `src/invalid-map-line.ts` content with | ||
``` | ||
console.log('hello happy world'); | ||
``` | ||
5. Run `.2` again | ||
6. Replace source map comment of `../data/invalid-map-line.js` with one from `.3` |
Oops, something went wrong.