Skip to content

Commit 067657c

Browse files
karamatsko
authored andcommitted
fix(ivy): prevent templateOverrides from causing infinite loop (angular#29402)
Previously, the transitive scope calculation could lead into re-compiling the same module multiple times. This fix ensures we cannot get into this loop. It should be fixed more completely (e.g. more cases) once FW-1178 is resolved. PR Close angular#29402
1 parent 8714daf commit 067657c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/testing/src/r3_test_bed.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,8 @@ export class TestBedRender3 implements Injector, TestBed {
822822
// if we have template override via `TestBed.overrideTemplateUsingTestingModule` -
823823
// define Component scope as TestingModule scope, instead of the scope of NgModule
824824
// where this Component was declared
825-
calcTransitiveScopesFor(this._testModuleType) :
825+
// TODO: This is only a partial fix. Should be fixed completely with FW-1178 refactor.
826+
transitiveScopesFor(this._testModuleType) :
826827
transitiveScope;
827828
patchComponentDefWithScope((cmp as any).ngComponentDef, scope);
828829
});

0 commit comments

Comments
 (0)