Skip to content

Commit

Permalink
fixup! perf(core): do not recursive into modules that have already be…
Browse files Browse the repository at this point in the history
…en registered
  • Loading branch information
JoostK committed Oct 30, 2020
1 parent 4e57dee commit af1412e
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 af1412e

Please sign in to comment.