angular/packages/core/src
Andrew Kushnir 22533fb5b4 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:07 -08:00
..
change_detection refactor(core): rename ngInjectableDef to ɵprov (#33151) 2019-10-16 16:36:19 -04:00
compiler fix(ivy): throw a better error when DI can't inject a ctor param (#33739) (#34340) 2019-12-11 08:48:10 -08:00
debug fix(ivy): inconsistent attribute casing in DebugNode.attributes on IE (#34305) 2019-12-13 14:19:58 -08:00
di fix(ivy): reorder provider type checks to align with VE (#34433) 2019-12-16 12:44:28 -08:00
i18n feat(common): support loading locales from a global (#33523) 2019-11-05 17:27:00 +00:00
interface feat(core): Add "AbstractType<T>" interface (#29295) 2019-04-02 16:07:22 -07:00
linker fix(core): make QueryList implement Iterable in the type system (#33536) 2019-11-19 13:43:53 -08:00
metadata docs(core): add new example for HostListener (#34228) 2019-12-09 10:38:02 -08:00
reflection perf: don't create holey arrays (#32155) 2019-08-21 08:27:43 -07:00
render refactor(core): remove deprecated Renderer (#33019) 2019-10-08 09:23:00 -07:00
render3 fix(ivy): skip field inheritance if InheritDefinitionFeature is present on parent def (#34244) 2020-01-07 10:28:07 -08:00
sanitization fix(ivy): i18n instructions thrown off by sanitizer in IE11 (#34305) 2019-12-13 14:19:58 -08:00
testability build: update zone.js to 0.9.0 (#28219) 2019-03-26 12:50:38 -07:00
util Revert "refactor: use isObservable provided by rxjs 6.1+ (#27668)" 2019-11-27 14:08:42 -08:00
view style: enforce disallowance of object constructor (#33211) 2019-12-03 10:08:26 -08:00
zone feat: add a flag in bootstrap to enable coalesce event change detection to improve performance (#30533) 2019-11-05 18:58:25 +00:00
application_init.ts docs: update core to use @publicApi tags (#26595) 2018-10-19 14:35:53 -07:00
application_module.ts fix(core): ensure that ngI18nClosureMode is guarded (#34211) 2019-12-03 16:18:13 -08:00
application_ref.ts fix(core): remove deprecated and defunct wtf* apis (#33949) 2019-11-25 18:39:18 -05:00
application_tokens.ts docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
change_detection.ts refactor(core): remove deprecated TrackByFn (#18757) 2017-08-18 13:23:46 -05:00
codegen_private_exports.ts fix(ivy): align NgModule registration timing with ViewEngine (#30244) 2019-05-13 11:13:25 -07:00
console.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
core.externs.js fix(core): remove deprecated and defunct wtf* apis (#33949) 2019-11-25 18:39:18 -05:00
core.ts fix(core): remove deprecated and defunct wtf* apis (#33949) 2019-11-25 18:39:18 -05:00
core_private_export.ts Revert "refactor: use isObservable provided by rxjs 6.1+ (#27668)" 2019-11-27 14:08:42 -08:00
core_render3_private_export.ts fix(ivy): ensure that the correct document is available (#33712) 2019-11-11 14:01:05 -08:00
di.ts refactor(ivy): create Injector interface; remove dependency on Ivy (#28066) 2019-01-11 16:24:03 -08:00
error_handler.ts refactor(ivy): refactor more files in DI to prepare it for bazel packages (#28098) 2019-01-14 09:55:30 -08:00
errors.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
event_emitter.ts docs(core): mark EventEmitter#__isAsync as internal to hide from API docs (#31378) 2019-10-03 10:24:34 -07:00
ivy_switch.ts refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
linker.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
metadata.ts docs: fix and add decorator api doc (#28986) 2019-03-04 11:47:30 -08:00
platform_core_providers.ts docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
r3_symbols.ts refactor(ivy): generate ngFactoryDef for injectables (#32433) 2019-10-02 13:04:26 -07:00
render.ts refactor(core): remove deprecated Renderer (#33019) 2019-10-08 09:23:00 -07:00
version.ts docs: update core to use @publicApi tags (#26595) 2018-10-19 14:35:53 -07:00
zone.ts feat(router): warn if navigation triggered outside Angular zone (#24959) 2018-09-05 09:35:14 -07:00