Skip to content

Commit cb5879f

Browse files
JeanMechethePunderWoman
authored andcommitted
refactor(core): remove ng when invoking enableProdMode
This was caught while investigating a leak.
1 parent 029685b commit cb5879f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/util/is_dev_mode.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ export function enableProdMode(): void {
4040
// `global['ngDevMode'] = false;` is also dropped.
4141
if (typeof ngDevMode === 'undefined' || ngDevMode) {
4242
global['ngDevMode'] = false;
43+
// The ngGlobal might already be init, for because initNgDevMode() is invoked from the top level,
44+
// an this function might executed later. So we need to clean up the global.ng as well.
45+
global['ng'] = undefined;
4346
}
4447
}

0 commit comments

Comments
 (0)