fix(core): ensure that `ngI18nClosureMode` is guarded (#34211)
If the `ngI18nClosureMode` global check actually makes it through to the runtime, then checks for its existence should be guarded to prevent `Reference undefined` errors in strict mode. (Normally, it is stripped out by dead code elimination during build optimization.) PR Close #34211
This commit is contained in:
parent
cca2616637
commit
bc7cde0f01
|
@ -49,7 +49,8 @@ export function _localeFactory(locale?: string): string {
|
|||
* * Ivy enabled: use `$localize.locale`
|
||||
*/
|
||||
export function getGlobalLocale(): string {
|
||||
if (ngI18nClosureMode && typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
|
||||
if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
|
||||
typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
|
||||
// * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
|
||||
// * In order to preserve backwards compatibility, we use Angular default value over
|
||||
// Closure Compiler's one.
|
||||
|
|
Loading…
Reference in New Issue