fix(Compiler): relax childIsRecursive check (#8705)
Fix how the compiler checks for recursive components by also considering component descendants. Previously, it only checked if the current component was evaluated previously. This failed in certain cases of mutually recursive components, causing `createAsync` in tests to not resolve. closes [7084](https://github.com/angular/angular/issues/7084)
This commit is contained in:
@ -115,7 +115,9 @@ export class RuntimeCompiler implements ComponentResolver {
|
||||
this._metadataResolver.getViewDirectivesMetadata(dep.comp.type.runtime);
|
||||
var childViewPipes: CompilePipeMetadata[] =
|
||||
this._metadataResolver.getViewPipesMetadata(dep.comp.type.runtime);
|
||||
var childIsRecursive = ListWrapper.contains(childCompilingComponentsPath, childCacheKey);
|
||||
var childIsRecursive = childCompilingComponentsPath.indexOf(childCacheKey) > -1 ||
|
||||
childViewDirectives.some(
|
||||
dir => childCompilingComponentsPath.indexOf(dir.type.runtime) > -1);
|
||||
childCompilingComponentsPath.push(childCacheKey);
|
||||
|
||||
var childComp = this._loadAndCompileComponent(
|
||||
|
Reference in New Issue
Block a user