Skip to content

Commit d9d68e7

Browse files
crisbetothePunderWoman
authored andcommitted
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
1 parent 0b1dd39 commit d9d68e7

56 files changed

Lines changed: 176 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 24)); };
1+
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyOtherPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 24)); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 16)); };
1+
MyPipe.ɵfac = function MyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPipe)($i0$.ɵɵdirectiveInject($i0$.ChangeDetectorRef, 16)); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)(); };
1+
MyPipe.ɵfac = function MyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPipe)(); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MyPurePipe.ɵfac = function MyPurePipe_Factory(t) { return new (t || MyPurePipe)(); };
1+
MyPurePipe.ɵfac = function MyPurePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyPurePipe)(); };
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ForOfDirective.ɵfac = function ForOfDirective_Factory(t) {
2-
return new (t || ForOfDirective)($r3$.ɵɵdirectiveInject($r3$.ViewContainerRef), $r3$.ɵɵdirectiveInject($r3$.TemplateRef));
1+
ForOfDirective.ɵfac = function ForOfDirective_Factory(__ngFactoryType__) {
2+
return new (__ngFactoryType__ || ForOfDirective)($r3$.ɵɵdirectiveInject($r3$.ViewContainerRef), $r3$.ɵɵdirectiveInject($r3$.TemplateRef));
33
};
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OtherDirective.ɵfac = function OtherDirective_Factory(t) {return new (t || OtherDirective)(); };
1+
OtherDirective.ɵfac = function OtherDirective_Factory(__ngFactoryType__) {return new (__ngFactoryType__ || OtherDirective)(); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SomeDirective.ɵfac = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };
1+
SomeDirective.ɵfac = function SomeDirective_Factory(__ngFactoryType__) {return new (__ngFactoryType__ || SomeDirective)(); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ChildComponent.ɵfac = function ChildComponent_Factory(t) { return new (t || ChildComponent)(); };
1+
ChildComponent.ɵfac = function ChildComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChildComponent)(); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ChildComponent.ɵfac = function ChildComponent_Factory(t) { return new (t || ChildComponent)(); };
1+
ChildComponent.ɵfac = function ChildComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChildComponent)(); };
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
1+
MyComponent.ɵfac = function MyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MyComponent)(); };

0 commit comments

Comments
 (0)