fix(ivy): don't accidently read the inherited definition (#25736)

Create getter methods `getXXXDef` for each definition which
uses `hasOwnProperty` to verify that we don't accidently read form the
parent class.

Fixes: #24011
Fixes: #25026

PR Close #25736
This commit is contained in:
Miško Hevery
2018-08-29 16:34:44 -07:00
committed by Igor Minar
parent a9099e8f70
commit d5bd86ae5d
29 changed files with 245 additions and 103 deletions

View File

@ -9,12 +9,15 @@
import {ChangeDetectionStrategy} from '../change_detection/constants';
import {Provider} from '../di';
import {R3_COMPILE_COMPONENT, R3_COMPILE_DIRECTIVE, R3_COMPILE_PIPE} from '../ivy_switch';
import {NG_BASE_DEF} from '../render3/fields';
import {Type} from '../type';
import {TypeDecorator, makeDecorator, makePropDecorator} from '../util/decorators';
import {fillProperties} from '../util/property';
import {ViewEncapsulation} from './view';
/**
* Type of the Directive decorator / constructor function.
*/
@ -778,11 +781,6 @@ const initializeBaseDef = (target: any): void => {
}
};
/**
* Used to get the minified alias of ngBaseDef
*/
const NG_BASE_DEF = Object.keys({ngBaseDef: true})[0];
/**
* Does the work of creating the `ngBaseDef` property for the @Input and @Output decorators.
* @param key "inputs" or "outputs"