27a4adebcb
The compiler uses a `Reference` abstraction to refer to TS nodes that it needs to refer to from other parts of the source. Such references keep track of any identifiers that represent the referenced node. Prior to this commit, the compiler (and specifically `ReferenceEmitter` classes) assumed that the reference identifiers are always free standing. In other words a reference identifier would be an expression like `FooDirective` in the expression `class FooDirective {}`. But in UMD/CommonJS source, a reference can actually refer to an "exports" declaration of the form `exports.FooDirective = ...`. In such cases the `FooDirective` identifier is not free-standing since it is part of a property access, so the `ReferenceEmitter` should take this into account when emitting an expression that refers to such a `Reference`. This commit changes the `LocalIdentifierStrategy` reference emitter so that if the `node` being referenced is not a declaration itself and is in the current file, then it should be used directly, rather than trying to use one of its identifiers. PR Close #39346 |
||
---|---|---|
.. | ||
diagnostics | ||
metadata | ||
ngtsc | ||
transformers | ||
extract_i18n.ts | ||
language_services.ts | ||
main.ts | ||
perform_compile.ts | ||
perform_watch.ts | ||
tooling.ts | ||
typescript_support.ts | ||
version.ts |