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:
mcalmus 2020-03-13 08:28:40 -04:00 committed by Andrew Kushnir
parent a3812c6cbd
commit 4610093c87
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ export function initNgDevMode(): boolean {
if (typeof ngDevMode !== 'object') {
ngDevModeResetPerfCounters();
}
return !!ngDevMode;
return typeof ngDevMode !== 'undefined' && !!ngDevMode;
}
return false;
}