fix(compiler-cli): avoid producing source mappings for host views (#19965)
The host view doesn't map back to user code so the template compiler produces a blank `url` for them. PR Close #19965
This commit is contained in:
parent
00bc80bb37
commit
22c66f0e02
|
@ -144,12 +144,14 @@ class _NodeEmitterVisitor implements StatementVisitor, ExpressionVisitor {
|
||||||
const span = node.sourceSpan;
|
const span = node.sourceSpan;
|
||||||
if (span.start.file == span.end.file) {
|
if (span.start.file == span.end.file) {
|
||||||
const file = span.start.file;
|
const file = span.start.file;
|
||||||
let source = this._templateSources.get(file);
|
if (file.url) {
|
||||||
if (!source) {
|
let source = this._templateSources.get(file);
|
||||||
source = ts.createSourceMapSource(file.url, file.content, pos => pos);
|
if (!source) {
|
||||||
this._templateSources.set(file, source);
|
source = ts.createSourceMapSource(file.url, file.content, pos => pos);
|
||||||
|
this._templateSources.set(file, source);
|
||||||
|
}
|
||||||
|
return {pos: span.start.offset, end: span.end.offset, source};
|
||||||
}
|
}
|
||||||
return {pos: span.start.offset, end: span.end.offset, source};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue