Skip to content

Commit fc54d16

Browse files
Alan Agiusmgechev
Alan Agius
authored andcommitted
fix(@ngtools/webpack): import as results in the alias being undefined with Typescript 3.2
When using the `specifier.propertyName` with `typeChecker.getSymbolAtLocation` it will return a more detailed symbol then we originally have in the `usedSymbols` set. We should probably use `symbol.id` to actually check if the symbols are the same, however the `id` is not exposed in the Symbol interface. Using `node.name` will return the same symbol that we have stored in the set. Fixes angular#13212
1 parent b21eb8d commit fc54d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/elide_imports.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function elideImports(
100100
// "import { XYZ, ... } from 'abc';"
101101
const specifierOps = [];
102102
for (const specifier of node.importClause.namedBindings.elements) {
103-
if (isUnused(specifier.propertyName || specifier.name)) {
103+
if (isUnused(specifier.name)) {
104104
specifierOps.push(new RemoveNodeOperation(sourceFile, specifier));
105105
}
106106
}

0 commit comments

Comments
 (0)