]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fix #3626 further refactor
authorChris Myers <cmyers2015@outlook.com>
Thu, 19 Oct 2017 20:16:43 +0000 (21:16 +0100)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 11 Nov 2017 19:39:22 +0000 (21:39 +0200)
src/lib/locale/locales.js

index d3c565e7984fe7365d503f63cf746822ea03db13..e45415fcad4c962773133ffb0d2a4d8031d8ec66 100644 (file)
@@ -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);