fix(ivy): use closure-safe field name for JIT of ngInjectableDef (#24632)
PR Close #24632
This commit is contained in:
parent
89c442270a
commit
855e8ad9f6
|
@ -12,6 +12,7 @@ const TARGET = {} as any;
|
||||||
|
|
||||||
export const NG_COMPONENT_DEF = getClosureSafeProperty({ngComponentDef: TARGET}, TARGET);
|
export const NG_COMPONENT_DEF = getClosureSafeProperty({ngComponentDef: TARGET}, TARGET);
|
||||||
export const NG_DIRECTIVE_DEF = getClosureSafeProperty({ngDirectiveDef: 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_INJECTOR_DEF = getClosureSafeProperty({ngInjectorDef: TARGET}, TARGET);
|
||||||
export const NG_PIPE_DEF = getClosureSafeProperty({ngPipeDef: TARGET}, TARGET);
|
export const NG_PIPE_DEF = getClosureSafeProperty({ngPipeDef: TARGET}, TARGET);
|
||||||
export const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: TARGET}, TARGET);
|
export const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: TARGET}, TARGET);
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {Type} from '../../type';
|
||||||
import {getClosureSafeProperty} from '../../util/property';
|
import {getClosureSafeProperty} from '../../util/property';
|
||||||
|
|
||||||
import {angularCoreEnv} from './environment';
|
import {angularCoreEnv} from './environment';
|
||||||
|
import {NG_INJECTABLE_DEF} from './fields';
|
||||||
import {convertDependencies, reflectDependencies} from './util';
|
import {convertDependencies, reflectDependencies} from './util';
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ export function compileInjectable(type: Type<any>, meta?: Injectable): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
let def: any = null;
|
let def: any = null;
|
||||||
Object.defineProperty(type, 'ngInjectableDef', {
|
Object.defineProperty(type, NG_INJECTABLE_DEF, {
|
||||||
get: () => {
|
get: () => {
|
||||||
if (def === null) {
|
if (def === null) {
|
||||||
// Check whether the injectable metadata includes a provider specification.
|
// Check whether the injectable metadata includes a provider specification.
|
||||||
|
|
Loading…
Reference in New Issue