8000 fixup! perf(core): do not recurse into modules that have already been… · angular/angular@2b05235 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b05235

Browse files
committed
fixup! perf(core): do not recurse into modules that have already been registered
1 parent dfaf450 commit 2b05235

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/linker/ng_module_factory_registration.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export function registerNgModuleType(ngModuleType: NgModuleType): void {
4444
const visited = new Set<NgModuleType>();
4545
recurse(ngModuleType);
4646
function recurse(ngModuleType: NgModuleType): void {
47-
const def = getNgModuleDef(ngModuleType, true);
47+
// The imports array of an NgModule must refer to other NgModules,
48+
// so an error is thrown if no module definition is available.
49+
const def = getNgModuleDef(ngModuleType, /* throwNotFound */ true);
4850
const id = def.id;
4951
if (id !== null) {
5052
const existing = modules.get(id) as NgModuleType | null;

0 commit comments

Comments
 (0)
0