refactor(compiler-cli): remove redundant `potentialSourceMapUrl` property (#42000)

Now that there is no need to work around the source-map bug in TypeScript
(https://github.com/Microsoft/TypeScript/issues/29300) we can just use
`resolvedTemplateUrl` for the source-map URL, rather than having a separate
property.

PR Close #42000
This commit is contained in:
Pete Bacon Darwin 2021-05-08 09:12:54 +01:00 committed by Alex Rickabaugh
parent 6912b1b364
commit 089daea98b
1 changed files with 2 additions and 5 deletions

View File

@ -1082,7 +1082,7 @@ export class ComponentDecoratorHandler implements
type: 'direct',
node: template.expression,
};
sourceMapUrl = template.potentialSourceMapUrl;
sourceMapUrl = template.resolvedTemplateUrl;
} else {
const resolvedTemplate = this.evaluator.evaluate(template.expression);
if (typeof resolvedTemplate !== 'string') {
@ -1123,7 +1123,7 @@ export class ComponentDecoratorHandler implements
...this._parseTemplate(
template, /* sourceStr */ templateContent, /* sourceParseRange */ null,
/* escapedString */ false,
/* sourceMapUrl */ template.potentialSourceMapUrl),
/* sourceMapUrl */ template.resolvedTemplateUrl),
content: templateContent,
sourceMapping: {
type: 'external',
@ -1230,7 +1230,6 @@ export class ComponentDecoratorHandler implements
templateUrl,
templateUrlExpression: templateUrlExpr,
resolvedTemplateUrl: resourceUrl,
potentialSourceMapUrl: resourceUrl,
};
} catch (e) {
throw this.makeResourceNotFoundError(
@ -1244,7 +1243,6 @@ export class ComponentDecoratorHandler implements
expression: component.get('template')!,
templateUrl: containingFile,
resolvedTemplateUrl: containingFile,
potentialSourceMapUrl: containingFile,
};
} else {
throw new FatalDiagnosticError(
@ -1394,7 +1392,6 @@ interface CommonTemplateDeclaration {
interpolationConfig: InterpolationConfig;
templateUrl: string;
resolvedTemplateUrl: string;
potentialSourceMapUrl: string;
}
/**