angular/packages/core
Andrew Kushnir effb92dfae fix(ivy): skip field inheritance if InheritDefinitionFeature is present on parent def (#34244)
The main logic of the `InheritDefinitionFeature` is to go through the prototype chain of a given Component and merge all Angular-specific information onto that Component def. The problem happens in case there is a Component in a hierarchy that also contains the `InheritDefinitionFeature` (i.e. it extends some other Component), so it inherits all Angular-specific information from its super class. As a result, the root Component may end up having duplicate information inherited from different Components in hierarchy.

Let's consider the following structure: `GrandChild` extends `Child` that extends `Base` and the `Base` class has a `HostListener`. In this scenario `GrandChild` and `Child` will have `InheritDefinitionFeature` included into the `features` list. The processing will happend in the following order:

- `Child` inherits `HostListener` from the `Base` class
- `GrandChild` inherits `HostListener` from the `Child` class
- since `Child` has a parent, `GrandChild` also inherits from the `Base` class

The result is that the `GrandChild` def has duplicated host listener, which is not correct.

This commit introduces additional logic that checks whether we came across a def that has `InheritDefinitionFeature` feature (which means that this def already inherited information from its super classes). If that's the case, we skip further fields-related inheritance logic, but keep going though the prototype chain to look for super classes that contain other features (like NgOnChanges), that we need to invoke for a given Component def.

PR Close #34244
2020-01-07 10:28:06 -08:00
..
schematics test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
src fix(ivy): skip field inheritance if InheritDefinitionFeature is present on parent def (#34244) 2020-01-07 10:28:06 -08:00
test fix(ivy): skip field inheritance if InheritDefinitionFeature is present on parent def (#34244) 2020-01-07 10:28:06 -08:00
testing fix(ivy): TestBed not unwrapping imports array function when overriding provider (#34629) 2020-01-06 11:38:02 -08:00
BUILD.bazel build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
global.ts feat(docs-infra): add the ability to expose globals (#34237) 2019-12-06 10:58:09 -08:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json build: set up all packages to publish via wombot proxy (#33747) 2019-11-13 11:34:33 -08:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
public_api.ts build: publish tree of files rather than FESMs (#18541) 2017-08-31 15:34:50 -07:00