mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(compiler): reduce chance of conflicts between generated factory and local variables (#57181)
Currently we use some short variable names like `t` and `r` in the generated factory functions. They can conflict with local symbols with the same names, if they're used for DI. These changes rename the parameters to reduce the change for conflicts. Fixes #57168. PR Close #57181
This commit is contained in:
parent
0b1dd39663
commit
d9d68e73d2
56 changed files with 176 additions and 156 deletions
|
|
@ -1 +1 @@
|
|||
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 24)); };
|
||||
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyOtherPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 24)); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 16)); };
|
||||
MyPipe.ɵfac = function MyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 16)); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)(); };
|
||||
MyPipe.ɵfac = function MyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPipe)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyPurePipe.ɵfac = function MyPurePipe_Factory(t) { return new (t || MyPurePipe)(); };
|
||||
MyPurePipe.ɵfac = function MyPurePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPurePipe)(); };
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
ForOfDirective.ɵfac = function ForOfDirective_Factory(t) {
|
||||
return new (t || ForOfDirective)($r3$.ɵɵdirectiveInject($r3$.ViewContainerRef), $r3$.ɵɵdirectiveInject($r3$.TemplateRef));
|
||||
ForOfDirective.ɵfac = function ForOfDirective_Factory(__ngFactoryType__) {
|
||||
return new (__ngFactoryType__ || ForOfDirective)($r3$.ɵɵdirectiveInject($r3$.ViewContainerRef), $r3$.ɵɵdirectiveInject($r3$.TemplateRef));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
OtherDirective.ɵfac = function OtherDirective_Factory(t) {return new (t || OtherDirective)(); };
|
||||
OtherDirective.ɵfac = function OtherDirective_Factory(__ngFactoryType__) {return new (__ngFactoryType__ || OtherDirective)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
SomeDirective.ɵfac = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };
|
||||
SomeDirective.ɵfac = function SomeDirective_Factory(__ngFactoryType__) {return new (__ngFactoryType__ || SomeDirective)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
ChildComponent.ɵfac = function ChildComponent_Factory(t) { return new (t || ChildComponent)(); };
|
||||
ChildComponent.ɵfac = function ChildComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChildComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
ChildComponent.ɵfac = function ChildComponent_Factory(t) { return new (t || ChildComponent)(); };
|
||||
ChildComponent.ɵfac = function ChildComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChildComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
SomeDirective.ɵfac = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };
|
||||
SomeDirective.ɵfac = function SomeDirective_Factory(__ngFactoryType__) {return new (__ngFactoryType__ || SomeDirective)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
SomeDirective.ɵfac = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };
|
||||
SomeDirective.ɵfac = function SomeDirective_Factory(__ngFactoryType__) {return new (__ngFactoryType__ || SomeDirective)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
EmptyOutletComponent.ɵfac = function EmptyOutletComponent_Factory(t) { return new (t || EmptyOutletComponent)(); };
|
||||
EmptyOutletComponent.ɵfac = function EmptyOutletComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EmptyOutletComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
IfDirective.ɵfac = function IfDirective_Factory(t) { return new (t || IfDirective)($r3$.ɵɵdirectiveInject($i$.TemplateRef)); };
|
||||
IfDirective.ɵfac = function IfDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IfDirective)($r3$.ɵɵdirectiveInject($i$.TemplateRef)); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) {
|
||||
return new (t || MyComponent)(
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) {
|
||||
return new (__ngFactoryType__ || MyComponent)(
|
||||
$r3$.ɵɵdirectiveInject($i$.ElementRef), $r3$.ɵɵdirectiveInject($i$.ViewContainerRef),
|
||||
$r3$.ɵɵdirectiveInject($i$.ChangeDetectorRef));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
BasicModule.ɵfac = function BasicModule_Factory(t) { return new (t || BasicModule)(); };
|
||||
BasicModule.ɵfac = function BasicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BasicModule)(); };
|
||||
BasicModule.ɵmod = /*@__PURE__*/ $i0$.ɵɵdefineNgModule({type: BasicModule, id: 'BasicModuleId'});
|
||||
BasicModule.ɵinj = /*@__PURE__*/ $i0$.ɵɵdefineInjector({});
|
||||
…
|
||||
$i0$.ɵɵregisterNgModuleType(BasicModule, 'BasicModuleId');
|
||||
$i0$.ɵɵregisterNgModuleType(BasicModule, 'BasicModuleId');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
BasicModule.ɵfac = function BasicModule_Factory(t) { return new (t || BasicModule)(); };
|
||||
BasicModule.ɵfac = function BasicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BasicModule)(); };
|
||||
BasicModule.ɵmod = /*@__PURE__*/ $i0$.ɵɵdefineNgModule({type: BasicModule, id: 'BasicModuleId'});
|
||||
BasicModule.ɵinj = /*@__PURE__*/ $i0$.ɵɵdefineInjector({});
|
||||
…
|
||||
$i0$.ɵɵregisterNgModuleType(BasicModule, 'BasicModuleId');
|
||||
$i0$.ɵɵregisterNgModuleType(BasicModule, 'BasicModuleId');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
BasicModule.ɵfac = function BasicModule_Factory(t) { return new (t || BasicModule)(); };
|
||||
BasicModule.ɵfac = function BasicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BasicModule)(); };
|
||||
BasicModule.ɵmod = function() {
|
||||
$i0$.ɵɵregisterNgModuleType(BasicModule, 'BasicModuleId');
|
||||
return /*@__PURE__*/ $i0$.ɵɵdefineNgModule({type: BasicModule, id: 'BasicModuleId'});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ BarDirective.ɵdir…
|
|||
QuxPipe.ɵfac…
|
||||
QuxPipe.ɵpipe…
|
||||
|
||||
FooModule.ɵfac = function FooModule_Factory(t) { return new (t || FooModule)(); };
|
||||
FooModule.ɵfac = function FooModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FooModule)(); };
|
||||
FooModule.ɵmod = /*@__PURE__*/ $i0$.ɵɵdefineNgModule({type: FooModule, bootstrap: [FooComponent]});
|
||||
FooModule.ɵinj = /*@__PURE__*/ $i0$.ɵɵdefineInjector({});
|
||||
…
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ BarDirective.ɵdir…
|
|||
QuxPipe.ɵfac…
|
||||
QuxPipe.ɵpipe…
|
||||
|
||||
FooModule.ɵfac = function FooModule_Factory(t) { return new (t || FooModule)(); };
|
||||
FooModule.ɵfac = function FooModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FooModule)(); };
|
||||
FooModule.ɵmod = /*@__PURE__*/ $i0$.ɵɵdefineNgModule({type: FooModule, bootstrap: [FooComponent], declarations: [FooComponent, BarDirective, QuxPipe]});
|
||||
FooModule.ɵinj = /*@__PURE__*/ $i0$.ɵɵdefineInjector({});
|
||||
…
|
||||
|
|
@ -16,4 +16,4 @@ FooModule.ɵinj = /*@__PURE__*/ $i0$.ɵɵdefineInjector({});
|
|||
type: NgModule,
|
||||
args: [{ declarations: [FooComponent, BarDirective, QuxPipe], bootstrap: [FooComponent] }]
|
||||
}], null, null);
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ export function provideModule() {
|
|||
}
|
||||
…
|
||||
export class TestModule {}
|
||||
TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); };
|
||||
TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); };
|
||||
TestModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: TestModule, imports: () => [ForwardModule] });
|
||||
TestModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [provideModule()] });
|
||||
…
|
||||
export class ForwardModule {}
|
||||
ForwardModule.ɵfac = function ForwardModule_Factory(t) { return new (t || ForwardModule)(); };
|
||||
ForwardModule.ɵfac = function ForwardModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ForwardModule)(); };
|
||||
ForwardModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ForwardModule });
|
||||
ForwardModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
||||
ForwardModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ export function provideModule() {
|
|||
}
|
||||
…
|
||||
class TestModule {}
|
||||
TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); };
|
||||
TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); };
|
||||
TestModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: TestModule, imports: function () { return [ForwardModule]; } });
|
||||
TestModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [provideModule()] });
|
||||
export { TestModule };
|
||||
…
|
||||
class ForwardModule {}
|
||||
ForwardModule.ɵfac = function ForwardModule_Factory(t) { return new (t || ForwardModule)(); };
|
||||
ForwardModule.ɵfac = function ForwardModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ForwardModule)(); };
|
||||
ForwardModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ForwardModule });
|
||||
ForwardModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
||||
export { ForwardModule };
|
||||
export { ForwardModule };
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export class AModule {}
|
||||
AModule.ɵfac = function AModule_Factory(t) { return new (t || AModule)(); };
|
||||
AModule.ɵfac = function AModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AModule)(); };
|
||||
AModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AModule });
|
||||
AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
||||
…
|
||||
|
|
@ -12,7 +12,7 @@ AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|||
…
|
||||
|
||||
export class BModule {}
|
||||
BModule.ɵfac = function BModule_Factory(t) { return new (t || BModule)(); };
|
||||
BModule.ɵfac = function BModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BModule)(); };
|
||||
BModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: BModule });
|
||||
BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] });
|
||||
…
|
||||
|
|
@ -25,7 +25,7 @@ BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] });
|
|||
…
|
||||
|
||||
export class AppModule {}
|
||||
AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); };
|
||||
AppModule.ɵfac = function AppModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppModule)(); };
|
||||
AppModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AppModule });
|
||||
AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] });
|
||||
…
|
||||
|
|
@ -34,4 +34,4 @@ AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] });
|
|||
type: NgModule,
|
||||
args: [{ imports: [BModule] }]
|
||||
}], null, null);
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export class AModule {}
|
||||
AModule.ɵfac = function AModule_Factory(t) { return new (t || AModule)(); };
|
||||
AModule.ɵfac = function AModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AModule)(); };
|
||||
AModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AModule });
|
||||
AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [A1Component, A2Component] });
|
||||
…
|
||||
|
|
@ -12,7 +12,7 @@ AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [A1Component, A2C
|
|||
…
|
||||
|
||||
export class BModule {}
|
||||
BModule.ɵfac = function BModule_Factory(t) { return new (t || BModule)(); };
|
||||
BModule.ɵfac = function BModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BModule)(); };
|
||||
BModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: BModule });
|
||||
BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] });
|
||||
…
|
||||
|
|
@ -25,7 +25,7 @@ BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] });
|
|||
…
|
||||
|
||||
export class AppModule {}
|
||||
AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); };
|
||||
AppModule.ɵfac = function AppModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppModule)(); };
|
||||
AppModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AppModule });
|
||||
AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] });
|
||||
…
|
||||
|
|
@ -34,4 +34,4 @@ AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] });
|
|||
type: NgModule,
|
||||
args: [{ imports: [BModule] }]
|
||||
}], null, null);
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export class AModule {}
|
||||
AModule.ɵfac = function AModule_Factory(t) { return new (t || AModule)(); };
|
||||
AModule.ɵfac = function AModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AModule)(); };
|
||||
AModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AModule, declarations: [A1Component, A2Component], exports: [A1Component, A2Component] });
|
||||
AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
||||
…
|
||||
|
|
@ -11,7 +11,7 @@ AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|||
})();
|
||||
…
|
||||
export class BModule {}
|
||||
BModule.ɵfac = function BModule_Factory(t) { return new (t || BModule)(); };
|
||||
BModule.ɵfac = function BModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BModule)(); };
|
||||
BModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: BModule, declarations: [B1Component, B2Component], exports: [AModule] });
|
||||
BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] });
|
||||
…
|
||||
|
|
@ -23,7 +23,7 @@ BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] });
|
|||
})();
|
||||
…
|
||||
export class AppModule {}
|
||||
AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); };
|
||||
AppModule.ɵfac = function AppModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppModule)(); };
|
||||
AppModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AppModule, imports: [BModule] });
|
||||
AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] });
|
||||
…
|
||||
|
|
@ -32,4 +32,4 @@ AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] });
|
|||
type: NgModule,
|
||||
args: [{ imports: [BModule] }]
|
||||
}], null, null);
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export class BaseModule {
|
||||
constructor(service) { this.service = service; }
|
||||
}
|
||||
BaseModule.ɵfac = function BaseModule_Factory(t) { return new (t || BaseModule)(i0.ɵɵinject(Service)); };
|
||||
BaseModule.ɵfac = function BaseModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseModule)(i0.ɵɵinject(Service)); };
|
||||
BaseModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: BaseModule });
|
||||
BaseModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [Service] });
|
||||
(() => {
|
||||
|
|
@ -16,8 +16,8 @@ export class BasicModule extends BaseModule {
|
|||
|
||||
BasicModule.ɵfac = /*@__PURE__*/ (() => {
|
||||
let ɵBasicModule_BaseFactory;
|
||||
return function BasicModule_Factory(t) {
|
||||
return (ɵBasicModule_BaseFactory || (ɵBasicModule_BaseFactory = i0.ɵɵgetInheritedFactory(BasicModule)))(t || BasicModule);
|
||||
return function BasicModule_Factory(__ngFactoryType__) {
|
||||
return (ɵBasicModule_BaseFactory || (ɵBasicModule_BaseFactory = i0.ɵɵgetInheritedFactory(BasicModule)))(__ngFactoryType__ || BasicModule);
|
||||
};
|
||||
})();
|
||||
|
||||
|
|
@ -29,4 +29,4 @@ BasicModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|||
args: [{}]
|
||||
}], null, null);
|
||||
})();
|
||||
…
|
||||
…
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export class BaseModule {
|
||||
constructor(service) { this.service = service; }
|
||||
}
|
||||
BaseModule.ɵfac = function BaseModule_Factory(t) { return new (t || BaseModule)(i0.ɵɵinject(Service)); };
|
||||
BaseModule.ɵfac = function BaseModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseModule)(i0.ɵɵinject(Service)); };
|
||||
BaseModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: BaseModule });
|
||||
BaseModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [Service] });
|
||||
(() => {
|
||||
|
|
@ -16,8 +16,8 @@ export class BasicModule extends BaseModule {
|
|||
|
||||
BasicModule.ɵfac = /*@__PURE__*/ (() => {
|
||||
let ɵBasicModule_BaseFactory;
|
||||
return function BasicModule_Factory(t) {
|
||||
return (ɵBasicModule_BaseFactory || (ɵBasicModule_BaseFactory = i0.ɵɵgetInheritedFactory(BasicModule)))(t || BasicModule);
|
||||
return function BasicModule_Factory(__ngFactoryType__) {
|
||||
return (ɵBasicModule_BaseFactory || (ɵBasicModule_BaseFactory = i0.ɵɵgetInheritedFactory(BasicModule)))(__ngFactoryType__ || BasicModule);
|
||||
};
|
||||
})();
|
||||
|
||||
|
|
@ -29,4 +29,4 @@ BasicModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|||
args: [{}]
|
||||
}], null, null);
|
||||
})();
|
||||
…
|
||||
…
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export class FooModule {}
|
||||
FooModule.ɵfac = function FooModule_Factory(t) { return new (t || FooModule)(); };
|
||||
FooModule.ɵfac = function FooModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FooModule)(); };
|
||||
FooModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: FooModule });
|
||||
FooModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
||||
Thing,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export class FooModule {}
|
||||
FooModule.ɵfac = function FooModule_Factory(t) { return new (t || FooModule)(); };
|
||||
FooModule.ɵfac = function FooModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FooModule)(); };
|
||||
FooModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: FooModule });
|
||||
FooModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
||||
Thing,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
MyComponent.ɵfac = function MyComponent_Factory(t) {
|
||||
return new (t || MyComponent)(
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) {
|
||||
return new (__ngFactoryType__ || MyComponent)(
|
||||
$r3$.ɵɵinjectAttribute('name'),
|
||||
$r3$.ɵɵinjectAttribute(dynamicAttrName()),
|
||||
$r3$.ɵɵdirectiveInject(MyService),
|
||||
|
|
@ -10,4 +10,4 @@ MyComponent.ɵfac = function MyComponent_Factory(t) {
|
|||
$r3$.ɵɵdirectiveInject(MyService, 8),
|
||||
$r3$.ɵɵdirectiveInject(MyService, 10)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
MyService.ɵfac = function MyService_Factory(t) {
|
||||
return new (t || MyService)($r3$.ɵɵinject(MyDependency), $r3$.ɵɵinject(MyOptionalDependency, 8));
|
||||
MyService.ɵfac = function MyService_Factory(__ngFactoryType__) {
|
||||
return new (__ngFactoryType__ || MyService)($r3$.ɵɵinject(MyDependency), $r3$.ɵɵinject(MyOptionalDependency, 8));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
MyService.ɵfac = function MyService_Factory(t) {
|
||||
return new (t || MyService)($r3$.ɵɵinject(MyDependency));
|
||||
MyService.ɵfac = function MyService_Factory(__ngFactoryType__) {
|
||||
return new (__ngFactoryType__ || MyService)($r3$.ɵɵinject(MyDependency));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// NOTE The prov definition must be last so MyOtherPipe.fac is defined
|
||||
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($r3$.ɵɵdirectiveInject(Service, 16)); };
|
||||
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyOtherPipe)($r3$.ɵɵdirectiveInject(Service, 16)); };
|
||||
MyOtherPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "myOtherPipe", type: MyOtherPipe, pure: true });
|
||||
MyOtherPipe.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MyOtherPipe, factory: MyOtherPipe.ɵfac });
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// NOTE The prov definition must be last so MyPipe.fac is defined
|
||||
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)(i0.ɵɵdirectiveInject(Service, 16)); };
|
||||
MyPipe.ɵfac = function MyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPipe)(i0.ɵɵdirectiveInject(Service, 16)); };
|
||||
MyPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "myPipe", type: MyPipe, pure: true });
|
||||
MyPipe.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MyPipe, factory: MyPipe.ɵfac });
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Service.ɵfac = function Service_Factory(t) { return new (t || Service)($i0$.ɵɵinject(Dep)); };
|
||||
Service.ɵfac = function Service_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Service)($i0$.ɵɵinject(Dep)); };
|
||||
Service.ɵprov = /*@__PURE__*/ $i0$.ɵɵdefineInjectable({ token: Service, factory: Service.ɵfac, providedIn: $i0$.forwardRef(() => Mod) });
|
||||
(() => {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(Service, [{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
SomeProvider.ɵprov = /*@__PURE__*/ $r3$.ɵɵdefineInjectable({
|
||||
token: SomeProvider,
|
||||
factory: t => SomeProviderImpl.ɵfac(t),
|
||||
factory: __ngFactoryType__ => SomeProviderImpl.ɵfac(__ngFactoryType__),
|
||||
providedIn: 'root'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
MyService.ɵprov = /*@__PURE__*/ $r3$.ɵɵdefineInjectable({
|
||||
token: MyService,
|
||||
factory: function MyService_Factory(t) {
|
||||
let r = null;
|
||||
if (t) {
|
||||
r = new t();
|
||||
factory: function MyService_Factory(__ngFactoryType__) {
|
||||
let __ngConditionalFactory__ = null;
|
||||
if (__ngFactoryType__) {
|
||||
__ngConditionalFactory__ = new __ngFactoryType__();
|
||||
} else {
|
||||
r = new MyAlternateService($r3$.ɵɵinject(SomeDep));
|
||||
__ngConditionalFactory__ = new MyAlternateService($r3$.ɵɵinject(SomeDep));
|
||||
}
|
||||
return r;
|
||||
return __ngConditionalFactory__;
|
||||
},
|
||||
providedIn: 'root'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
MyService.ɵprov = /*@__PURE__*/ $r3$.ɵɵdefineInjectable({
|
||||
token: MyService,
|
||||
factory: t => MyAlternateService.ɵfac(t),
|
||||
factory: __ngFactoryType__ => MyAlternateService.ɵfac(__ngFactoryType__),
|
||||
providedIn: 'root'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
MyService.ɵprov = /*@__PURE__*/ $r3$.ɵɵdefineInjectable({
|
||||
token: MyService,
|
||||
factory: function MyService_Factory(t) {
|
||||
let r = null;
|
||||
if (t) {
|
||||
r = new t();
|
||||
factory: function MyService_Factory(__ngFactoryType__) {
|
||||
let __ngConditionalFactory__ = null;
|
||||
if (__ngFactoryType__) {
|
||||
__ngConditionalFactory__ = new __ngFactoryType__();
|
||||
} else {
|
||||
r = ((dep, optional) => new MyAlternateService(dep, optional))($r3$.ɵɵinject(SomeDep), $r3$.ɵɵinject(SomeDep, 8));
|
||||
__ngConditionalFactory__ = ((dep, optional) => new MyAlternateService(dep, optional))($r3$.ɵɵinject(SomeDep), $r3$.ɵɵinject(SomeDep, 8));
|
||||
}
|
||||
return r;
|
||||
return __ngConditionalFactory__;
|
||||
},
|
||||
providedIn: 'root'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) {
|
||||
return new (t || MyComponent)();
|
||||
};
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) {
|
||||
return new (__ngFactoryType__ || MyComponent)();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainComponent.ɵfac = function MainComponent_Factory(t) { return new (t || MainComponent)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
`MainComponent.ɵfac = function MainComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainComponent)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1082,7 +1082,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainComponent.ɵfac = function MainComponent_Factory(t) { return new (t || MainComponent)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
`MainComponent.ɵfac = function MainComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainComponent)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1122,7 +1122,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainDirective.ɵfac = function MainDirective_Factory(t) { return new (t || MainDirective)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
`MainDirective.ɵfac = function MainDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainDirective)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1157,7 +1157,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainDirective.ɵfac = function MainDirective_Factory(t) { return new (t || MainDirective)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
`MainDirective.ɵfac = function MainDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainDirective)(i0.ɵɵdirectiveInject(i1.SomeService1), i0.ɵɵdirectiveInject(SomeService2), i0.ɵɵdirectiveInject(i2.SomeService3), i0.ɵɵdirectiveInject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1196,7 +1196,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainPipe.ɵfac = function MainPipe_Factory(t) { return new (t || MainPipe)(i0.ɵɵdirectiveInject(i1.SomeService1, 16), i0.ɵɵdirectiveInject(SomeService2, 16), i0.ɵɵdirectiveInject(i2.SomeService3, 16), i0.ɵɵdirectiveInject(i3.nested.SomeService4, 16), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN, 16)); };`,
|
||||
`MainPipe.ɵfac = function MainPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainPipe)(i0.ɵɵdirectiveInject(i1.SomeService1, 16), i0.ɵɵdirectiveInject(SomeService2, 16), i0.ɵɵdirectiveInject(i2.SomeService3, 16), i0.ɵɵdirectiveInject(i3.nested.SomeService4, 16), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN, 16)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1232,7 +1232,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainPipe.ɵfac = function MainPipe_Factory(t) { return new (t || MainPipe)(i0.ɵɵdirectiveInject(i1.SomeService1, 16), i0.ɵɵdirectiveInject(SomeService2, 16), i0.ɵɵdirectiveInject(i2.SomeService3, 16), i0.ɵɵdirectiveInject(i3.nested.SomeService4, 16), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN, 16)); };`,
|
||||
`MainPipe.ɵfac = function MainPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainPipe)(i0.ɵɵdirectiveInject(i1.SomeService1, 16), i0.ɵɵdirectiveInject(SomeService2, 16), i0.ɵɵdirectiveInject(i2.SomeService3, 16), i0.ɵɵdirectiveInject(i3.nested.SomeService4, 16), i0.ɵɵinjectAttribute('title'), i0.ɵɵdirectiveInject(MESSAGE_TOKEN, 16)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1267,7 +1267,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainService.ɵfac = function MainService_Factory(t) { return new (t || MainService)(i0.ɵɵinject(i1.SomeService1), i0.ɵɵinject(SomeService2), i0.ɵɵinject(i2.SomeService3), i0.ɵɵinject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵinject(MESSAGE_TOKEN)); };`,
|
||||
`MainService.ɵfac = function MainService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainService)(i0.ɵɵinject(i1.SomeService1), i0.ɵɵinject(SomeService2), i0.ɵɵinject(i2.SomeService3), i0.ɵɵinject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵinject(MESSAGE_TOKEN)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1301,7 +1301,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainModule.ɵfac = function MainModule_Factory(t) { return new (t || MainModule)(i0.ɵɵinject(i1.SomeService1), i0.ɵɵinject(SomeService2), i0.ɵɵinject(i2.SomeService3), i0.ɵɵinject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵinject(MESSAGE_TOKEN)); };`,
|
||||
`MainModule.ɵfac = function MainModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MainModule)(i0.ɵɵinject(i1.SomeService1), i0.ɵɵinject(SomeService2), i0.ɵɵinject(i2.SomeService3), i0.ɵɵinject(i3.nested.SomeService4), i0.ɵɵinjectAttribute('title'), i0.ɵɵinject(MESSAGE_TOKEN)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainService.ɵfac = function MainService_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MainService.ɵfac = function MainService_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1348,7 +1348,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainService.ɵfac = function MainService_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MainService.ɵfac = function MainService_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1373,7 +1373,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainService.ɵfac = function MainService_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MainService.ɵfac = function MainService_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1398,7 +1398,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MainService.ɵfac = function MainService_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MainService.ɵfac = function MainService_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1421,7 +1421,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1445,7 +1445,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1470,7 +1470,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1495,7 +1495,7 @@ runInEachFileSystem(() => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(t) { i0.ɵɵinvalidFactory(); };`,
|
||||
`MyDirective.ɵfac = function MyDirective_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); };`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -2630,7 +2630,7 @@ runInEachFileSystem(() => {
|
|||
'test.ts',
|
||||
`
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<span Hello! </span>',
|
||||
})
|
||||
|
|
@ -2657,7 +2657,7 @@ runInEachFileSystem(() => {
|
|||
'test.ts',
|
||||
`
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'test.ng.html',
|
||||
})
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ runInEachFileSystem((os: string) => {
|
|||
expect(jsContents).toContain('Dep.ɵprov =');
|
||||
expect(jsContents).toContain('Service.ɵprov =');
|
||||
expect(jsContents).toContain(
|
||||
'Service.ɵfac = function Service_Factory(t) { return new (t || Service)(i0.ɵɵinject(Dep)); };',
|
||||
'Service.ɵfac = function Service_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Service)(i0.ɵɵinject(Dep)); };',
|
||||
);
|
||||
expect(jsContents).toContain("providedIn: 'root' })");
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
|
|
@ -176,7 +176,9 @@ runInEachFileSystem((os: string) => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('Service.ɵprov =');
|
||||
expect(jsContents).toContain('factory: () => (() => new Service())()');
|
||||
expect(jsContents).toContain('Service_Factory(t) { return new (t || Service)(); }');
|
||||
expect(jsContents).toContain(
|
||||
'Service_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Service)(); }',
|
||||
);
|
||||
expect(jsContents).toContain(", providedIn: 'root' });");
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
|
|
@ -204,10 +206,14 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('Service.ɵprov =');
|
||||
expect(jsContents).toContain('factory: function Service_Factory(t) { let r = null; if (t) {');
|
||||
expect(jsContents).toContain('return new (t || Service)(i0.ɵɵinject(Dep));');
|
||||
expect(jsContents).toContain('r = ((dep) => new Service(dep))(i0.ɵɵinject(Dep));');
|
||||
expect(jsContents).toContain("return r; }, providedIn: 'root' });");
|
||||
expect(jsContents).toContain(
|
||||
'factory: function Service_Factory(__ngFactoryType__) { let __ngConditionalFactory__ = null; if (__ngFactoryType__) {',
|
||||
);
|
||||
expect(jsContents).toContain('return new (__ngFactoryType__ || Service)(i0.ɵɵinject(Dep));');
|
||||
expect(jsContents).toContain(
|
||||
'__ngConditionalFactory__ = ((dep) => new Service(dep))(i0.ɵɵinject(Dep));',
|
||||
);
|
||||
expect(jsContents).toContain("return __ngConditionalFactory__; }, providedIn: 'root' });");
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ɵprov: i0.ɵɵInjectableDeclaration<Service>;');
|
||||
|
|
@ -238,10 +244,14 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('Service.ɵprov =');
|
||||
expect(jsContents).toContain('factory: function Service_Factory(t) { let r = null; if (t) {');
|
||||
expect(jsContents).toContain('return new (t || Service)(i0.ɵɵinject(Dep));');
|
||||
expect(jsContents).toContain('r = ((dep) => new Service(dep))(i0.ɵɵinject(Dep, 10));');
|
||||
expect(jsContents).toContain(`return r; }, providedIn: 'root' });`);
|
||||
expect(jsContents).toContain(
|
||||
'factory: function Service_Factory(__ngFactoryType__) { let __ngConditionalFactory__ = null; if (__ngFactoryType__) {',
|
||||
);
|
||||
expect(jsContents).toContain('return new (__ngFactoryType__ || Service)(i0.ɵɵinject(Dep));');
|
||||
expect(jsContents).toContain(
|
||||
'__ngConditionalFactory__ = ((dep) => new Service(dep))(i0.ɵɵinject(Dep, 10));',
|
||||
);
|
||||
expect(jsContents).toContain(`return __ngConditionalFactory__; }, providedIn: 'root' });`);
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ɵprov: i0.ɵɵInjectableDeclaration<Service>;');
|
||||
|
|
@ -274,7 +284,7 @@ runInEachFileSystem((os: string) => {
|
|||
expect(jsContents).toContain('Service.ɵprov =');
|
||||
expect(jsContents).toContain('Mod.ɵmod =');
|
||||
expect(jsContents).toContain(
|
||||
'Service.ɵfac = function Service_Factory(t) { return new (t || Service)(i0.ɵɵinject(Dep)); };',
|
||||
'Service.ɵfac = function Service_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Service)(i0.ɵɵinject(Dep)); };',
|
||||
);
|
||||
expect(jsContents).toContain('providedIn: i0.forwardRef(() => Mod) })');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
|
|
@ -330,8 +340,8 @@ runInEachFileSystem((os: string) => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
`Service.ɵfac = function Service_Factory(t) { ` +
|
||||
`return new (t || Service)(i0.ɵɵinject(Dep), i0.ɵɵinject(OptionalDep, 8)); };`,
|
||||
`Service.ɵfac = function Service_Factory(__ngFactoryType__) { ` +
|
||||
`return new (__ngFactoryType__ || Service)(i0.ɵɵinject(Dep), i0.ɵɵinject(OptionalDep, 8)); };`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -704,7 +714,7 @@ runInEachFileSystem((os: string) => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('Dir.ɵfac = /** @pureOrBreakMyCode */ (() => {');
|
||||
expect(jsContents).toContain(
|
||||
'(ɵDir_BaseFactory || (ɵDir_BaseFactory = i0.ɵɵgetInheritedFactory(Dir)))(t || Dir);',
|
||||
'(ɵDir_BaseFactory || (ɵDir_BaseFactory = i0.ɵɵgetInheritedFactory(Dir)))(__ngFactoryType__ || Dir);',
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -1444,7 +1454,7 @@ runInEachFileSystem((os: string) => {
|
|||
'function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TestModule, { declarations: [TestCmp] }); })();',
|
||||
);
|
||||
expect(jsContents).toContain(
|
||||
'TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); }',
|
||||
'TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); }',
|
||||
);
|
||||
expect(jsContents).toContain('i0.ɵɵdefineInjector({});');
|
||||
|
||||
|
|
@ -1601,7 +1611,7 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); }',
|
||||
'TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); }',
|
||||
);
|
||||
expect(jsContents).toContain(
|
||||
'i0.ɵɵdefineInjector({ imports: [OtherModule, RouterModule.forRoot(),' +
|
||||
|
|
@ -1639,7 +1649,7 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); }',
|
||||
'TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); }',
|
||||
);
|
||||
expect(jsContents).toContain('i0.ɵɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain(
|
||||
|
|
@ -1685,7 +1695,7 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); }',
|
||||
'TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); }',
|
||||
);
|
||||
expect(jsContents).toContain('i0.ɵɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain(
|
||||
|
|
@ -1735,7 +1745,7 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'TestModule.ɵfac = function TestModule_Factory(t) { return new (t || TestModule)(); }',
|
||||
'TestModule.ɵfac = function TestModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestModule)(); }',
|
||||
);
|
||||
expect(jsContents).toContain('i0.ɵɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain(
|
||||
|
|
@ -2007,7 +2017,7 @@ runInEachFileSystem((os: string) => {
|
|||
'TestPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "test-pipe", type: TestPipe, pure: false })',
|
||||
);
|
||||
expect(jsContents).toContain(
|
||||
'TestPipe.ɵfac = function TestPipe_Factory(t) { return new (t || TestPipe)(); }',
|
||||
'TestPipe.ɵfac = function TestPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestPipe)(); }',
|
||||
);
|
||||
expect(dtsContents).toContain(
|
||||
'static ɵpipe: i0.ɵɵPipeDeclaration<TestPipe, "test-pipe", false>;',
|
||||
|
|
@ -2037,7 +2047,7 @@ runInEachFileSystem((os: string) => {
|
|||
'TestPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "test-pipe", type: TestPipe, pure: true })',
|
||||
);
|
||||
expect(jsContents).toContain(
|
||||
'TestPipe.ɵfac = function TestPipe_Factory(t) { return new (t || TestPipe)(); }',
|
||||
'TestPipe.ɵfac = function TestPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestPipe)(); }',
|
||||
);
|
||||
expect(dtsContents).toContain(
|
||||
'static ɵpipe: i0.ɵɵPipeDeclaration<TestPipe, "test-pipe", false>;',
|
||||
|
|
@ -2066,7 +2076,9 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('return new (t || TestPipe)(i0.ɵɵdirectiveInject(Dep, 16));');
|
||||
expect(jsContents).toContain(
|
||||
'return new (__ngFactoryType__ || TestPipe)(i0.ɵɵdirectiveInject(Dep, 16));',
|
||||
);
|
||||
});
|
||||
|
||||
it('should compile Pipes with generic types', () => {
|
||||
|
|
@ -3443,7 +3455,9 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m);
|
||||
expect(jsContents).toMatch(
|
||||
/function Test_Factory\(__ngFactoryType__\) { i0\.ɵɵinvalidFactory\(\)/m,
|
||||
);
|
||||
});
|
||||
|
||||
it('should not give a compile-time error if an invalid @Injectable is used with useFactory', () => {
|
||||
|
|
@ -3465,7 +3479,9 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m);
|
||||
expect(jsContents).toMatch(
|
||||
/function Test_Factory\(__ngFactoryType__\) { i0\.ɵɵinvalidFactory\(\)/m,
|
||||
);
|
||||
});
|
||||
|
||||
it('should not give a compile-time error if an invalid @Injectable is used with useExisting', () => {
|
||||
|
|
@ -3489,7 +3505,9 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m);
|
||||
expect(jsContents).toMatch(
|
||||
/function Test_Factory\(__ngFactoryType__\) { i0\.ɵɵinvalidFactory\(\)/m,
|
||||
);
|
||||
});
|
||||
|
||||
it('should not give a compile-time error if an invalid @Injectable is used with useClass', () => {
|
||||
|
|
@ -3513,7 +3531,9 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m);
|
||||
expect(jsContents).toMatch(
|
||||
/function Test_Factory\(__ngFactoryType__\) { i0\.ɵɵinvalidFactory\(\)/m,
|
||||
);
|
||||
});
|
||||
|
||||
it('should not give a compile-time error if an invalid @Injectable without providedIn is an abstract class', () => {
|
||||
|
|
@ -3532,7 +3552,9 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m);
|
||||
expect(jsContents).toMatch(
|
||||
/function Test_Factory\(__ngFactoryType__\) { i0\.ɵɵinvalidFactory\(\)/m,
|
||||
);
|
||||
});
|
||||
|
||||
it('should not give a compile-time error if an invalid @Injectable with providedIn is an abstract class', () => {
|
||||
|
|
@ -3553,7 +3575,9 @@ runInEachFileSystem((os: string) => {
|
|||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m);
|
||||
expect(jsContents).toMatch(
|
||||
/function Test_Factory\(__ngFactoryType__\) { i0\.ɵɵinvalidFactory\(\)/m,
|
||||
);
|
||||
});
|
||||
|
||||
it('should give a compile-time error when a derived Directive inherits an invalid constructor', () => {
|
||||
|
|
@ -3815,7 +3839,7 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'Test.ɵfac = function Test_Factory(t) { i0.ɵɵinvalidFactory()',
|
||||
'Test.ɵfac = function Test_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory()',
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -3835,7 +3859,7 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'Test.ɵfac = function Test_Factory(t) { i0.ɵɵinvalidFactory()',
|
||||
'Test.ɵfac = function Test_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory()',
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -4034,7 +4058,7 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'Test.ɵfac = function Test_Factory(t) { i0.ɵɵinvalidFactory()',
|
||||
'Test.ɵfac = function Test_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory()',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -4056,7 +4080,7 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'Test.ɵfac = function Test_Factory(t) { i0.ɵɵinvalidFactory()',
|
||||
'Test.ɵfac = function Test_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory()',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -4530,7 +4554,7 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
`FooCmp.ɵfac = function FooCmp_Factory(t) { return new (t || FooCmp)(i0.ɵɵinjectAttribute("test"), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }`,
|
||||
`FooCmp.ɵfac = function FooCmp_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FooCmp)(i0.ɵɵinjectAttribute("test"), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -5575,13 +5599,13 @@ runInEachFileSystem((os: string) => {
|
|||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain(
|
||||
'function Base_Factory(t) { return new (t || Base)(i0.ɵɵinject(Dep)); }',
|
||||
'function Base_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Base)(i0.ɵɵinject(Dep)); }',
|
||||
);
|
||||
expect(jsContents).toContain(
|
||||
'(() => { let ɵChild_BaseFactory; return function Child_Factory(t) { return (ɵChild_BaseFactory || (ɵChild_BaseFactory = i0.ɵɵgetInheritedFactory(Child)))(t || Child); }; })();',
|
||||
'(() => { let ɵChild_BaseFactory; return function Child_Factory(__ngFactoryType__) { return (ɵChild_BaseFactory || (ɵChild_BaseFactory = i0.ɵɵgetInheritedFactory(Child)))(__ngFactoryType__ || Child); }; })();',
|
||||
);
|
||||
expect(jsContents).toContain(
|
||||
'function GrandChild_Factory(t) { return new (t || GrandChild)(); }',
|
||||
'function GrandChild_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GrandChild)(); }',
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -5607,7 +5631,7 @@ runInEachFileSystem((os: string) => {
|
|||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain(
|
||||
'/*@__PURE__*/ (() => { let ɵDir_BaseFactory; return function Dir_Factory(t) { return (ɵDir_BaseFactory || (ɵDir_BaseFactory = i0.ɵɵgetInheritedFactory(Dir)))(t || Dir); }; })();',
|
||||
'/*@__PURE__*/ (() => { let ɵDir_BaseFactory; return function Dir_Factory(__ngFactoryType__) { return (ɵDir_BaseFactory || (ɵDir_BaseFactory = i0.ɵɵgetInheritedFactory(Dir)))(__ngFactoryType__ || Dir); }; })();',
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ import {
|
|||
import {Identifiers} from './render3/r3_identifiers';
|
||||
import {
|
||||
convertFromMaybeForwardRefExpression,
|
||||
ForwardRefHandling,
|
||||
generateForwardRef,
|
||||
MaybeForwardRefExpression,
|
||||
R3CompiledExpression,
|
||||
R3Reference,
|
||||
|
|
@ -187,8 +185,6 @@ function delegateToFactory(
|
|||
}
|
||||
|
||||
function createFactoryFunction(type: o.Expression): o.ArrowFunctionExpr {
|
||||
return o.arrowFn(
|
||||
[new o.FnParam('t', o.DYNAMIC_TYPE)],
|
||||
type.prop('ɵfac').callFn([o.variable('t')]),
|
||||
);
|
||||
const t = new o.FnParam('__ngFactoryType__', o.DYNAMIC_TYPE);
|
||||
return o.arrowFn([t], type.prop('ɵfac').callFn([o.variable(t.name)]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export interface R3DependencyMetadata {
|
|||
* Construct a factory function expression for the given `R3FactoryMetadata`.
|
||||
*/
|
||||
export function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression {
|
||||
const t = o.variable('t');
|
||||
const t = o.variable('__ngFactoryType__');
|
||||
let baseFactoryVar: o.ReadVarExpr | null = null;
|
||||
|
||||
// The type to instantiate via constructor invocation. If there is no delegated factory, meaning
|
||||
|
|
@ -139,7 +139,7 @@ export function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpre
|
|||
let retExpr: o.Expression | null = null;
|
||||
|
||||
function makeConditionalFactory(nonCtorExpr: o.Expression): o.ReadVarExpr {
|
||||
const r = o.variable('r');
|
||||
const r = o.variable('__ngConditionalFactory__');
|
||||
body.push(r.set(o.NULL_EXPR).toDeclStmt());
|
||||
const ctorStmt =
|
||||
ctorExpr !== null
|
||||
|
|
@ -184,7 +184,7 @@ export function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpre
|
|||
}
|
||||
|
||||
let factoryFn: o.Expression = o.fn(
|
||||
[new o.FnParam('t', o.DYNAMIC_TYPE)],
|
||||
[new o.FnParam(t.name, o.DYNAMIC_TYPE)],
|
||||
body,
|
||||
o.INFERRED_TYPE,
|
||||
undefined,
|
||||
|
|
|
|||
Loading…
Reference in a new issue