From 067657c1e9f1b4e42346c7f46f43ee7c7264240f Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Tue, 19 Mar 2019 13:01:23 -0700 Subject: [PATCH] fix(ivy): prevent templateOverrides from causing infinite loop (#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 #29402 --- packages/core/testing/src/r3_test_bed.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/testing/src/r3_test_bed.ts b/packages/core/testing/src/r3_test_bed.ts index d385180bba..4689b0f8cb 100644 --- a/packages/core/testing/src/r3_test_bed.ts +++ b/packages/core/testing/src/r3_test_bed.ts @@ -822,7 +822,8 @@ export class TestBedRender3 implements Injector, TestBed { // if we have template override via `TestBed.overrideTemplateUsingTestingModule` - // define Component scope as TestingModule scope, instead of the scope of NgModule // where this Component was declared - calcTransitiveScopesFor(this._testModuleType) : + // TODO: This is only a partial fix. Should be fixed completely with FW-1178 refactor. + transitiveScopesFor(this._testModuleType) : transitiveScope; patchComponentDefWithScope((cmp as any).ngComponentDef, scope); });