angular-cn/packages/compiler-cli/ngcc/test/host
JoostK 3858b26211 refactor(ivy): mark synthetic decorators explicitly (#33362)
In ngcc's migration system, synthetic decorators can be injected into a
compilation to ensure that certain classes are compiled with Angular
logic, where the original library code did not include the necessary
decorators. Prior to this change, synthesized decorators would have a
fake AST structure as associated node and a made-up identifier. In
theory, this may introduce issues downstream:

1) a decorator's node is used for diagnostics, so it must have position
information. Having fake AST nodes without a position is therefore a
problem. Note that this is currently not a problem in practice, as
injected synthesized decorators would not produce any diagnostics.

2) the decorator's identifier should refer to an imported symbol.
Therefore, it is required that the symbol is actually imported.
Moreover, bundle formats such as UMD and CommonJS use namespaces for
imports, so a bare `ts.Identifier` would not be suitable to use as
identifier. This was also not a problem in practice, as the identifier
is only used in the `setClassMetadata` generated code, which is omitted
for synthetically injected decorators.

To remedy these potential issues, this commit makes a decorator's
identifier optional and switches its node over from a fake AST structure
to the class' name.

PR Close #33362
2019-10-25 09:16:49 -07:00
..
commonjs_host_import_helper_spec.ts refactor(ivy): mark synthetic decorators explicitly (#33362) 2019-10-25 09:16:49 -07:00
commonjs_host_spec.ts fix(ngcc): report the correct viaModule when reflecting over commonjs (#33192) 2019-10-17 19:43:39 -04:00
esm5_host_import_helper_spec.ts refactor(ivy): mark synthetic decorators explicitly (#33362) 2019-10-25 09:16:49 -07:00
esm5_host_spec.ts fix(ngcc): Esm5ReflectionHost.getDeclarationOfIdentifier should handle aliased inner declarations (#33252) 2019-10-18 14:41:25 -04:00
esm2015_host_import_helper_spec.ts refactor(ivy): mark synthetic decorators explicitly (#33362) 2019-10-25 09:16:49 -07:00
esm2015_host_spec.ts fix(ngcc): prevent reflected decorators from being clobbered (#33362) 2019-10-25 09:16:49 -07:00
umd_host_import_helper_spec.ts refactor(ivy): mark synthetic decorators explicitly (#33362) 2019-10-25 09:16:49 -07:00
umd_host_spec.ts fix(ngcc): resolve imports in `.d.ts` files for UMD/CommonJS bundles (#32619) 2019-09-12 13:18:20 -07:00
util.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00