Skip to content

Commit

Permalink
fixup! fix(compiler-cli): compute source-mappings for localized strings
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Aug 31, 2020
1 parent 40abce4 commit 91e92b4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions packages/compiler-cli/src/ngtsc/translator/src/translator.ts
Expand Up @@ -447,11 +447,8 @@ class ExpressionTranslatorVisitor implements ExpressionVisitor, StatementVisitor
this.setSourceMapRange(resolvedExpression, ast.getPlaceholderSourceSpan(i - 1));
const templatePart = ast.serializeI18nTemplatePart(i);
const templateMiddle = createTemplateMiddle(templatePart.cooked, templatePart.raw);

// this.setSourceMapRange(resolvedExpression, ast.getMessagePartSourceSpan(i));
this.setSourceMapRange(templateMiddle, ast.getMessagePartSourceSpan(i));
const templateSpan = ts.createTemplateSpan(resolvedExpression, templateMiddle);
// this.setSourceMapRange(templateSpan, ast.getMessagePartSourceSpan(i));
spans.push(templateSpan);
}
// Create the tail part
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-cli/test/ngtsc/template_mapping_spec.ts
Expand Up @@ -24,7 +24,7 @@ runInEachFileSystem((os) => {

beforeEach(() => {
env = NgtscTestEnvironment.setup(testFiles);
env.tsconfig({sourceMap: true, target: 'ES2015', enableI18nLegacyMessageIdFormat: false});
env.tsconfig({sourceMap: true, target: 'es2015', enableI18nLegacyMessageIdFormat: false});
});

describe('Inline templates', () => {
Expand Down

0 comments on commit 91e92b4

Please sign in to comment.