angular-docs-cn/packages/compiler-cli/src
Pete Bacon Darwin 27a4adebcb refactor(compiler-cli): support namespaced references (#39346)
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
2020-10-23 15:17:11 -07:00
..
diagnostics build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata feat(compiler-cli): add support for TypeScript 4.0 (#38076) 2020-08-24 13:06:59 -07:00
ngtsc refactor(compiler-cli): support namespaced references (#39346) 2020-10-23 15:17:11 -07:00
transformers refactor(compiler-cli): `attachComments()` now expects a defined `leadingComments` array (#39076) 2020-10-06 11:33:55 -07:00
extract_i18n.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
language_services.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
main.ts style(compiler-cli): remove unused constant (#38441) 2020-08-13 13:32:41 -07:00
perform_compile.ts fix(ngcc): report a warning if ngcc tries to use a solution-style tsconfig (#38003) 2020-07-14 13:21:31 -07:00
perform_watch.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tooling.ts refactor(compiler-cli): skip class decorators in tooling constructor parameters transform (#37545) 2020-06-15 12:47:57 -07:00
typescript_support.ts refactor(compiler): remove support for TypeScript 3.9 (#39313) 2020-10-19 14:34:45 -07:00
version.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00