Skip to content

Commit

Permalink
fixup! perf(core): do not recurse into modules that have already been…
Browse files Browse the repository at this point in the history
… registered
  • Loading branch information
JoostK committed Oct 30, 2020
1 parent dfaf450 commit 2b05235
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/linker/ng_module_factory_registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export function registerNgModuleType(ngModuleType: NgModuleType): void {
const visited = new Set<NgModuleType>();
recurse(ngModuleType);
function recurse(ngModuleType: NgModuleType): void {
const def = getNgModuleDef(ngModuleType, true);
// The imports array of an NgModule must refer to other NgModules,
// so an error is thrown if no module definition is available.
const def = getNgModuleDef(ngModuleType, /* throwNotFound */ true);
const id = def.id;
if (id !== null) {
const existing = modules.get(id) as NgModuleType | null;
Expand Down

0 comments on commit 2b05235

Please sign in to comment.