mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
8d6c925392
`DeferredSymbolTracker.lookupIdentifiersInSourceFile` prunes `ts.isTypeNode` subtrees so that references appearing exclusively inside type annotations do not keep static import declarations in the emitted JavaScript. However, `ts.isTypeNode` returns `true` for `ts.ExpressionWithTypeArguments`, which TypeScript uses to represent both `extends` and `implements` heritage clauses. An `extends` clause on a class declaration or class expression is a value position that survives in the emitted JavaScript output. Because `isTypeNode` returned `true`, references to base classes imported alongside deferred dependencies were ignored. As a result, the compiler erroneously marked the static import statement as deferrable and deleted it from the emitted JavaScript, leaving the `extends <Base>` clause referencing an undeclared identifier and causing a runtime `ReferenceError`. This commit ensures that `ExpressionWithTypeArguments` under a class `extends` clause is not treated as an erasable type node, preserving the static import whenever a base class is referenced.