summaryrefslogtreecommitdiff
path: root/cli/compilers/ts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/compilers/ts.rs')
-rw-r--r--cli/compilers/ts.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs
index 4f822dc2c..a74e4a096 100644
--- a/cli/compilers/ts.rs
+++ b/cli/compilers/ts.rs
@@ -553,7 +553,9 @@ impl SourceMapGetter for TsCompiler {
.try_resolve_and_get_source_file(script_name)
.and_then(|out| {
str::from_utf8(&out.source_code).ok().and_then(|v| {
- let lines: Vec<&str> = v.lines().collect();
+ // Do NOT use .lines(): it skips the terminating empty line.
+ // (due to internally using .split_terminator() instead of .split())
+ let lines: Vec<&str> = v.split('\n').collect();
assert!(lines.len() > line);
Some(lines[line].to_string())
})