diff --git a/packages/compiler-cli/src/ngtsc/annotations/src/metadata.ts b/packages/compiler-cli/src/ngtsc/annotations/src/metadata.ts index af855d3b43..ce1a358c8a 100644 --- a/packages/compiler-cli/src/ngtsc/annotations/src/metadata.ts +++ b/packages/compiler-cli/src/ngtsc/annotations/src/metadata.ts @@ -28,7 +28,7 @@ export function generateSetClassMetadataCall( if (!reflection.isClass(clazz)) { return null; } - const id = ts.updateIdentifier(reflection.getAdjacentNameOfClass(clazz)); + const id = reflection.getAdjacentNameOfClass(clazz); // Reflect over the class decorators. If none are present, or those that are aren't from // Angular, then return null. Otherwise, turn them into metadata. diff --git a/packages/compiler-cli/src/ngtsc/imports/test/default_spec.ts b/packages/compiler-cli/src/ngtsc/imports/test/default_spec.ts index 0171459232..f07ea36462 100644 --- a/packages/compiler-cli/src/ngtsc/imports/test/default_spec.ts +++ b/packages/compiler-cli/src/ngtsc/imports/test/default_spec.ts @@ -69,7 +69,7 @@ runInEachFileSystem(() => { module: ts.ModuleKind.CommonJS, }); const fooClause = getDeclaration(program, _('/test.ts'), 'Foo', ts.isImportClause); - const fooId = ts.updateIdentifier(fooClause.name!); + const fooId = fooClause.name!; const fooDecl = fooClause.parent; const tracker = new DefaultImportTracker(); diff --git a/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.ts b/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.ts index cf17312b60..eea33c9bfe 100644 --- a/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.ts +++ b/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.ts @@ -59,9 +59,7 @@ export function typeToValue( return { kind: TypeValueReferenceKind.LOCAL, - // Copying the name here ensures the generated references will be correctly transformed - // along with the import. - expression: ts.updateIdentifier(firstDecl.name), + expression: firstDecl.name, defaultImportStatement: firstDecl.parent, }; } else if (ts.isImportSpecifier(firstDecl)) { diff --git a/packages/compiler-cli/src/ngtsc/switch/src/switch.ts b/packages/compiler-cli/src/ngtsc/switch/src/switch.ts index aa8897d74c..8d40c1e3db 100644 --- a/packages/compiler-cli/src/ngtsc/switch/src/switch.ts +++ b/packages/compiler-cli/src/ngtsc/switch/src/switch.ts @@ -110,10 +110,6 @@ function flipIvySwitchesInVariableStatement( stmt.getSourceFile().fileName} for the Ivy switch.`); } - // Copy the identifier with updateIdentifier(). This copies the internal information which - // allows TS to write a correct reference to the identifier. - newIdentifier = ts.updateIdentifier(newIdentifier); - newDeclarations[i] = ts.updateVariableDeclaration( /* node */ decl, /* name */ decl.name,