fix(ivy): use closure-safe field name for JIT of ngInjectableDef (#24632)

PR Close #24632
This commit is contained in:
Alex Rickabaugh 2018-06-19 11:41:00 -07:00 committed by Jason Aden
parent 89c442270a
commit 855e8ad9f6
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ const TARGET = {} as any;
export const NG_COMPONENT_DEF = getClosureSafeProperty({ngComponentDef: TARGET}, TARGET);
export const NG_DIRECTIVE_DEF = getClosureSafeProperty({ngDirectiveDef: TARGET}, TARGET);
export const NG_INJECTABLE_DEF = getClosureSafeProperty({ngInjectableDef: TARGET}, TARGET);
export const NG_INJECTOR_DEF = getClosureSafeProperty({ngInjectorDef: TARGET}, TARGET);
export const NG_PIPE_DEF = getClosureSafeProperty({ngPipeDef: TARGET}, TARGET);
export const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: TARGET}, TARGET);

View File

@ -14,6 +14,7 @@ import {Type} from '../../type';
import {getClosureSafeProperty} from '../../util/property';
import {angularCoreEnv} from './environment';
import {NG_INJECTABLE_DEF} from './fields';
import {convertDependencies, reflectDependencies} from './util';
@ -28,7 +29,7 @@ export function compileInjectable(type: Type<any>, meta?: Injectable): void {
}
let def: any = null;
Object.defineProperty(type, 'ngInjectableDef', {
Object.defineProperty(type, NG_INJECTABLE_DEF, {
get: () => {
if (def === null) {
// Check whether the injectable metadata includes a provider specification.