Skip to content

Commit

Permalink
fix(ivy): use closure-safe field name for JIT of ngInjectableDef (#24632
Browse files Browse the repository at this point in the history
)

PR Close #24632
  • Loading branch information
alxhub authored and jasonaden committed Jun 26, 2018
1 parent 89c4422 commit 855e8ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core/src/render3/jit/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
3 changes: 2 additions & 1 deletion packages/core/src/render3/jit/injectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';


Expand All @@ -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.
Expand Down

0 comments on commit 855e8ad

Please sign in to comment.