Skip to content

Commit 4610093

Browse files
mcalmusAndrewKushnir
authored andcommitted
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
1 parent a3812c6 commit 4610093

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/core/src/util/ng_dev_mode.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function initNgDevMode(): boolean {
115115
if (typeof ngDevMode !== 'object') {
116116
ngDevModeResetPerfCounters();
117117
}
118-
return !!ngDevMode;
118+
return typeof ngDevMode !== 'undefined' && !!ngDevMode;
119119
}
120120
return false;
121121
}

0 commit comments

Comments
 (0)