From 089daea98b5d32f7c79d6801e3abd3244f015626 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Sat, 8 May 2021 09:12:54 +0100 Subject: [PATCH] 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 --- .../compiler-cli/src/ngtsc/annotations/src/component.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/annotations/src/component.ts b/packages/compiler-cli/src/ngtsc/annotations/src/component.ts index 205d96431b..ab0da27d6e 100644 --- a/packages/compiler-cli/src/ngtsc/annotations/src/component.ts +++ b/packages/compiler-cli/src/ngtsc/annotations/src/component.ts @@ -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; } /**