fix(core): remove side effects from ɵɵNgOnChangesFeature() (#35769)

`ɵɵNgOnChangesFeature()` would set `ngInherit`, which is a side effect and also not necessary. This was pulled out to module scope so the function itself can be pure. Since it only curries another function, the call is entirely unnecessary. Updated the compiler to only generate a reference to this function, rather than a call to it, and removed the extra curry indirection.

PR Close #35769
This commit is contained in:
Doug Parker
2020-02-21 11:34:39 -08:00
committed by atscott
parent ba3612774f
commit 9cf85d2177
5 changed files with 16 additions and 16 deletions

View File

@ -2542,7 +2542,7 @@ describe('compiler compliance', () => {
type: LifecycleComp,
selectors: [["lifecycle-comp"]],
inputs: {nameMin: ["name", "nameMin"]},
features: [$r3$.ɵɵNgOnChangesFeature()],
features: [$r3$.ɵɵNgOnChangesFeature],
decls: 0,
vars: 0,
template: function LifecycleComp_Template(rf, ctx) {},
@ -2662,7 +2662,7 @@ describe('compiler compliance', () => {
ForOfDirective.ɵdir = $r3$.ɵɵdefineDirective({
type: ForOfDirective,
selectors: [["", "forOf", ""]],
features: [$r3$.ɵɵNgOnChangesFeature()],
features: [$r3$.ɵɵNgOnChangesFeature],
inputs: {forOf: "forOf"}
});
`;
@ -2742,7 +2742,7 @@ describe('compiler compliance', () => {
ForOfDirective.ɵdir = $r3$.ɵɵdefineDirective({
type: ForOfDirective,
selectors: [["", "forOf", ""]],
features: [$r3$.ɵɵNgOnChangesFeature()],
features: [$r3$.ɵɵNgOnChangesFeature],
inputs: {forOf: "forOf"}
});
`;
@ -3767,7 +3767,7 @@ describe('compiler compliance', () => {
// ...
BaseClass.ɵdir = $r3$.ɵɵdefineDirective({
type: BaseClass,
features: [$r3$.ɵɵNgOnChangesFeature()]
features: [$r3$.ɵɵNgOnChangesFeature]
});
// ...
`;