kopia lustrzana https://github.com/cheeaun/phanpy
Fix kinda invalid syntax for catch
rodzic
95bab85fb6
commit
24c59dbd6a
|
|
@ -22,7 +22,7 @@ export function refreshLocales() {
|
|||
const createLocale = mem((language, options = {}) => {
|
||||
try {
|
||||
return new Intl.Locale(language, options);
|
||||
} catch {
|
||||
} catch (e) {
|
||||
// Fallback to simple string splitting
|
||||
// May not work properly due to how complicated this is
|
||||
if (!language) return null;
|
||||
|
|
@ -77,7 +77,7 @@ const _DateTimeFormat = (locale, opts) => {
|
|||
|
||||
try {
|
||||
return new Intl.DateTimeFormat(matchedLocale, options);
|
||||
} catch {
|
||||
} catch (e) {
|
||||
return new Intl.DateTimeFormat(undefined, options);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function _getDtfLocale() {
|
|||
const dtfLocale = new Intl.DateTimeFormat().resolvedOptions().locale;
|
||||
store.session.set(DTFLOCALE_CACHE_KEY, dtfLocale);
|
||||
return dtfLocale;
|
||||
} catch {
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue