angular-docs-cn/integration/ngcc
JoostK d68ad3e617 fix(ivy): ngcc - recognize synthesized constructors (#27897)
A constructor function may have been "synthesized" by TypeScript during
JavaScript emit, in the case no user-defined constructor exists and e.g.
property initializers are used. Those initializers need to be emitted
into a constructor in JavaScript, so the TypeScript compiler generates a
synthetic constructor.

This commit adds identification of such constructors as ngcc needs to be
able to tell if a class did originally have a constructor in the
TypeScript source. When a class has a superclass, a synthesized
constructor must not be considered as a user-defined constructor as that
prevents a base factory call from being created by ngtsc, resulting in a
factory function that does not inject the dependencies of the superclass.
Hence, we identify a default synthesized super call in the constructor
body, according to the structure that TypeScript emits.

PR Close #27897
2019-01-09 11:48:10 -08:00
..
src test(ivy): ngcc - test compiling the Angular Material library (#26403) 2018-11-01 14:13:26 -07:00
debug-test.sh test(ivy): ngcc - test compiling the Angular Material library (#26403) 2018-11-01 14:13:26 -07:00
package.json test(ivy): ngcc - test compiling the Angular Material library (#26403) 2018-11-01 14:13:26 -07:00
test.sh fix(ivy): ngcc - recognize synthesized constructors (#27897) 2019-01-09 11:48:10 -08:00
tsconfig-app.json test(ivy): add an integration test for ngcc (#25406) 2018-08-22 19:28:56 -04:00
yarn.lock test(ivy): ngcc - update integration test dependency lock file (#26906) 2018-11-30 14:02:03 -08:00