"console": test.ts:1:0
".": test.ts:1:7
"log": test.ts:1:8
"(": test.ts:1:11
"'hello'": test.ts:1:12
")": test.ts:1:19
";": test.ts:1:20
"\n": test.ts:1:21 <-- line end
"console": test.ts:2:0
".": test.ts:2:7
"log": test.ts:2:8
"(": test.ts:2:11
"'world'": test.ts:2:12
")": test.ts:2:19
";": test.ts:2:20
"": test.ts:2:21 <-- line end
Expected behavior:
Line end characters left unmapped.
Actual behavior:
Line end characters are included in the mapping, with the column number that equals to the length of the line -- which exceeds the boundary, given that column number is 0-based in a source map.
The spec doesn't cover if mappings for line ending characters should be included. But this behavior breaks some tools (eg. source-map-explorer) with strict boundary checks.
TypeScript Version: Version 3.8.0-dev.20191023
Search Terms:
source map, source map new line
Code
test.ts
test.js
Source map breaks down into:
Expected behavior:
Line end characters left unmapped.
Actual behavior:
Line end characters are included in the mapping, with the column number that equals to the length of the line -- which exceeds the boundary, given that column number is 0-based in a source map.
The spec doesn't cover if mappings for line ending characters should be included. But this behavior breaks some tools (eg. source-map-explorer) with strict boundary checks.
Playground Link:
Related Issues: