fix(core): guard reading of global ngDevMode
for undefined. (#36055)
When reading globals such as `ngDevMode` the read should be guarded by `typeof ngDevMode` otherwise it will throw if not defined in `"use strict"` mode. PR Close #36055
This commit is contained in:
parent
a3812c6cbd
commit
4610093c87
@ -115,7 +115,7 @@ export function initNgDevMode(): boolean {
|
|||||||
if (typeof ngDevMode !== 'object') {
|
if (typeof ngDevMode !== 'object') {
|
||||||
ngDevModeResetPerfCounters();
|
ngDevModeResetPerfCounters();
|
||||||
}
|
}
|
||||||
return !!ngDevMode;
|
return typeof ngDevMode !== 'undefined' && !!ngDevMode;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user