From: Chris Myers Date: Thu, 19 Oct 2017 20:16:43 +0000 (+0100) Subject: Fix #3626 further refactor X-Git-Tag: 2.19.2~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebdfa5f2ecf6a6f7a232dafd942686808ab2e7e7;p=thirdparty%2Fmoment.git Fix #3626 further refactor --- diff --git a/src/lib/locale/locales.js b/src/lib/locale/locales.js index d3c565e79..e45415fca 100644 --- a/src/lib/locale/locales.js +++ b/src/lib/locale/locales.js @@ -131,16 +131,11 @@ export function defineLocale (name, config) { export function updateLocale(name, config) { if (config != null) { - var locale, parentConfig = baseConfig; + var locale, tmpLocale, parentConfig = baseConfig; // MERGE - if (locales[name] != null) { - parentConfig = locales[name]._config; - } - else { - locale = loadLocale(name); - if (locale != null) { - parentConfig = locale._config; - } + tmpLocale = locales[name] || loadLocale(name); + if (tmpLocale != null) { + parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); locale = new Locale(config);