Skip to content

Commit caf7228

Browse files
crisbetoalxhub
authored andcommitted
fix(compiler): resolve deprecation warning (#48652)
Fixes a deprecation warning that was being logged by compiler when generating aliases, because we weren't going through `ts.factory` to create an AST node. PR Close #48652
1 parent 896c04f commit caf7228

File tree

1 file changed

+2
-3
lines changed
  • packages/compiler-cli/src/ngtsc/transform/src

1 file changed

+2
-3
lines changed

packages/compiler-cli/src/ngtsc/transform/src/alias.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ts from 'typescript';
1010

1111
export function aliasTransformFactory(exportStatements: Map<string, Map<string, [string, string]>>):
1212
ts.TransformerFactory<ts.SourceFile> {
13-
return (context: ts.TransformationContext) => {
13+
return () => {
1414
return (file: ts.SourceFile) => {
1515
if (ts.isBundle(file) || !exportStatements.has(file.fileName)) {
1616
return file;
@@ -19,10 +19,9 @@ export function aliasTransformFactory(exportStatements: Map<string, Map<string,
1919
const statements = [...file.statements];
2020
exportStatements.get(file.fileName)!.forEach(([moduleName, symbolName], aliasName) => {
2121
const stmt = ts.factory.createExportDeclaration(
22-
/* decorators */ undefined,
2322
/* modifiers */ undefined,
2423
/* isTypeOnly */ false,
25-
/* exportClause */ ts.createNamedExports([ts.factory.createExportSpecifier(
24+
/* exportClause */ ts.factory.createNamedExports([ts.factory.createExportSpecifier(
2625
false, symbolName, aliasName)]),
2726
/* moduleSpecifier */ ts.factory.createStringLiteral(moduleName));
2827
statements.push(stmt);

0 commit comments

Comments
 (0)