Bug 1272523 - Store locale cache data in more robust order. r=jwalden
authorTooru Fujisawa <arai_a@mac.com>
Thu, 02 Jun 2016 07:43:14 +0900
changeset 341051 31d62c0b92a906a08f4da4567bf7ecbef6ee6b3d
parent 341050 32a8d48c26eeff52172de939d4d704104f8e5167
child 341052 09bc7ad8065f7219ec69df1c75799c129e319ea8
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1272523
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1272523 - Store locale cache data in more robust order. r=jwalden
js/src/builtin/Intl.js
--- a/js/src/builtin/Intl.js
+++ b/js/src/builtin/Intl.js
@@ -543,18 +543,18 @@ function DefaultLocaleIgnoringAvailableL
         // remove any present in the candidate.
         candidate = removeUnicodeExtensions(candidate);
 
         if (callFunction(std_Object_hasOwnProperty, oldStyleLanguageTagMappings, candidate))
             candidate = oldStyleLanguageTagMappings[candidate];
     }
 
     // Cache the candidate locale until the runtime default locale changes.
+    localeCandidateCache.candidateDefaultLocale = candidate;
     localeCandidateCache.runtimeDefaultLocale = runtimeDefaultLocale;
-    localeCandidateCache.candidateDefaultLocale = candidate;
 
     assert(IsStructurallyValidLanguageTag(candidate),
            "the candidate must be structurally valid");
     assert(localeContainsNoUnicodeExtensions(candidate),
            "the candidate must not contain a Unicode extension sequence");
 
     return candidate;
 }
@@ -592,18 +592,18 @@ function DefaultLocale() {
 
     assert(IsStructurallyValidLanguageTag(locale),
            "the computed default locale must be structurally valid");
     assert(locale === CanonicalizeLanguageTag(locale),
            "the computed default locale must be canonical");
     assert(localeContainsNoUnicodeExtensions(locale),
            "the computed default locale must not contain a Unicode extension sequence");
 
+    localeCache.defaultLocale = locale;
     localeCache.runtimeDefaultLocale = runtimeDefaultLocale;
-    localeCache.defaultLocale = locale;
 
     return locale;
 }
 
 
 /**
  * Verifies that the given string is a well-formed ISO 4217 currency code.
  *