Bug 1431957 - Move builtin/Intl.js (which now contains only shared functionality) to builtin/intl/CommonFunctions.js. r=anba
authorJeff Walden <jwalden@mit.edu>
Sat, 20 Jan 2018 12:41:06 -0800
changeset 401045 78bfd0529ebc98bdda5fa5ef515971e78ad969bd
parent 401044 9b62c6b3c1cf6eef1df690470fb086b55a7ae30d
child 401046 767fb4816abcdd14a973ba71fad66f086eeb9e5c
push id99283
push userjwalden@mit.edu
push dateSat, 27 Jan 2018 07:54:29 +0000
treeherdermozilla-inbound@c50cbf6e8176 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersanba
bugs1431957
milestone60.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 1431957 - Move builtin/Intl.js (which now contains only shared functionality) to builtin/intl/CommonFunctions.js. r=anba
js/src/builtin/Intl.js
js/src/builtin/intl/CommonFunctions.js
js/src/moz.build
rename from js/src/builtin/Intl.js
rename to js/src/builtin/intl/CommonFunctions.js
--- a/js/src/builtin/Intl.js
+++ b/js/src/builtin/intl/CommonFunctions.js
@@ -1,45 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Portions Copyright Norbert Lindenberg 2011-2012. */
 
-/*global JSMSG_INTL_OBJECT_NOT_INITED: false, JSMSG_INVALID_LOCALES_ELEMENT: false,
-         JSMSG_INVALID_LANGUAGE_TAG: false, JSMSG_INVALID_LOCALE_MATCHER: false,
-         JSMSG_INVALID_OPTION_VALUE: false, JSMSG_INVALID_DIGITS_VALUE: false,
-         JSMSG_INVALID_CURRENCY_CODE: false,
-         JSMSG_UNDEFINED_CURRENCY: false, JSMSG_INVALID_TIME_ZONE: false,
-         JSMSG_DATE_NOT_FINITE: false, JSMSG_INVALID_KEYS_TYPE: false,
-         JSMSG_INVALID_KEY: false,
-         intl_Collator_availableLocales: false,
-         intl_availableCollations: false,
-         intl_CompareStrings: false,
-         intl_NumberFormat_availableLocales: false,
-         intl_numberingSystem: false,
-         intl_FormatNumber: false,
-         intl_DateTimeFormat_availableLocales: false,
-         intl_availableCalendars: false,
-         intl_patternForSkeleton: false,
-         intl_FormatDateTime: false,
-         intl_SelectPluralRule: false,
-         intl_GetPluralCategories: false,
-         intl_GetCalendarInfo: false,
-*/
-
-/*
- * The Intl module specified by standard ECMA-402,
- * ECMAScript Internationalization API Specification.
- */
-
-
 /********** Locales, Time Zones, and Currencies **********/
 
-
 /**
  * Convert s to upper case, but limited to characters a-z.
  *
  * Spec: ECMAScript Internationalization API Specification, 6.1.
  */
 function toASCIIUpperCase(s) {
     assert(typeof s === "string", "toASCIIUpperCase");
 
@@ -83,17 +54,16 @@ internalIntlRegExps.currencyDigitsRE = n
  * Spec: ECMAScript Internationalization API Specification, 6.2.1.
  */
 function getUnicodeLocaleExtensionSequenceRE() {
     return internalIntlRegExps.unicodeLocaleExtensionSequenceRE ||
            (internalIntlRegExps.unicodeLocaleExtensionSequenceRE =
             RegExpCreate("-u(?:-[a-z0-9]{2,8})+"));
 }
 
-
 /**
  * Removes Unicode locale extension sequences from the given language tag.
  */
 function removeUnicodeExtensions(locale) {
     // A wholly-privateuse locale has no extension sequences.
     if (callFunction(std_String_startsWith, locale, "x-"))
         return locale;
 
@@ -122,17 +92,16 @@ function removeUnicodeExtensions(locale)
             return true;
         var xindex = callFunction(std_String_indexOf, combined, "-x-");
         return xindex > 0 && xindex < uindex;
     }(), "recombination failed to remove all Unicode locale extension sequences");
 
     return combined;
 }
 
-
 /**
  * Regular expression defining BCP 47 language tags.
  *
  * Spec: RFC 5646 section 2.1.
  */
 function getLanguageTagRE() {
     if (internalIntlRegExps.languageTagRE)
         return internalIntlRegExps.languageTagRE;
@@ -217,17 +186,16 @@ function getLanguageTagRE() {
     //               / privateuse          ; private use tag
     //               / grandfathered       ; grandfathered tags
     var languageTag = "^(?:" + langtag + "|" + privateuse + "|" + grandfathered + ")$";
 
     // Language tags are case insensitive (RFC 5646 section 2.1.1).
     return (internalIntlRegExps.languageTagRE = RegExpCreate(languageTag, "i"));
 }
 
-
 function getDuplicateVariantRE() {
     if (internalIntlRegExps.duplicateVariantRE)
         return internalIntlRegExps.duplicateVariantRE;
 
     // RFC 5234 section B.1
     // ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z
     var ALPHA = "[a-zA-Z]";
     // DIGIT          =  %x30-39
@@ -263,17 +231,16 @@ function getDuplicateVariantRE() {
     // addresses this -- but for the possibility of variant repetition with
     // differing case, e.g. "en-variant-Variant".  Use a case-insensitive
     // regular expression to address this.  (Note that there's no worry about
     // case transformation accepting invalid characters here: users have
     // already verified the string is alphanumeric Latin plus "-".)
     return (internalIntlRegExps.duplicateVariantRE = RegExpCreate(duplicateVariant, "i"));
 }
 
-
 function getDuplicateSingletonRE() {
     if (internalIntlRegExps.duplicateSingletonRE)
         return internalIntlRegExps.duplicateSingletonRE;
 
     // RFC 5234 section B.1
     // ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z
     var ALPHA = "[a-zA-Z]";
     // DIGIT          =  %x30-39
@@ -308,17 +275,16 @@ function getDuplicateSingletonRE() {
     // addresses this -- but for the possibility of singleton repetition with
     // differing case, e.g. "en-u-foo-U-foo".  Use a case-insensitive regular
     // expression to address this.  (Note that there's no worry about case
     // transformation accepting invalid characters here: users have already
     // verified the string is alphanumeric Latin plus "-".)
     return (internalIntlRegExps.duplicateSingletonRE = RegExpCreate(duplicateSingleton, "i"));
 }
 
-
 /**
  * Verifies that the given string is a well-formed BCP 47 language tag
  * with no duplicate variant or singleton subtags.
  *
  * Spec: ECMAScript Internationalization API Specification, 6.2.2.
  */
 function IsStructurallyValidLanguageTag(locale) {
     assert(typeof locale === "string", "IsStructurallyValidLanguageTag");
@@ -337,17 +303,16 @@ function IsStructurallyValidLanguageTag(
 
     // Check for duplicate variant or singleton subtags.
     var duplicateVariantRE = getDuplicateVariantRE();
     var duplicateSingletonRE = getDuplicateSingletonRE();
     return !regexp_test_no_statics(duplicateVariantRE, locale) &&
            !regexp_test_no_statics(duplicateSingletonRE, locale);
 }
 
-
 /**
  * Canonicalizes the given structurally valid BCP 47 language tag, including
  * regularized case of subtags. For example, the language tag
  * Zh-NAN-haNS-bu-variant2-Variant1-u-ca-chinese-t-Zh-laTN-x-PRIVATE, where
  *
  *     Zh             ; 2*3ALPHA
  *     -NAN           ; ["-" extlang]
  *     -haNS          ; ["-" script]
@@ -474,17 +439,16 @@ function CanonicalizeLanguageTag(locale)
             canonical += "-" + privateUse;
         else
             canonical = privateUse;
     }
 
     return canonical;
 }
 
-
 /**
  * Joins the array elements in the given range with the supplied separator.
  */
 function ArrayJoinRange(array, separator, from, to = array.length) {
     assert(typeof separator === "string", "|separator| is a string value");
     assert(typeof from === "number", "|from| is a number value");
     assert(typeof to === "number", "|to| is a number value");
     assert(0 <= from && from <= to && to <= array.length, "|from| and |to| form a valid range");
@@ -494,32 +458,30 @@ function ArrayJoinRange(array, separator
 
     var result = array[from];
     for (var i = from + 1; i < to; i++) {
         result += separator + array[i];
     }
     return result;
 }
 
-
 /**
  * Returns true if the input contains only ASCII alphabetical characters.
  */
 function IsASCIIAlphaString(s) {
     assert(typeof s === "string", "IsASCIIAlphaString");
 
     for (var i = 0; i < s.length; i++) {
         var c = callFunction(std_String_charCodeAt, s, i);
         if (!((0x41 <= c && c <= 0x5A) || (0x61 <= c && c <= 0x7A)))
             return false;
     }
     return true;
 }
 
-
 /**
  * Validates and canonicalizes the given language tag.
  */
 function ValidateAndCanonicalizeLanguageTag(locale) {
     assert(typeof locale === "string", "ValidateAndCanonicalizeLanguageTag");
 
     // Handle the common case (a standalone language) first.
     // Only the following BCP47 subset is accepted:
@@ -550,17 +512,16 @@ function ValidateAndCanonicalizeLanguage
     }
 
     if (!IsStructurallyValidLanguageTag(locale))
         ThrowRangeError(JSMSG_INVALID_LANGUAGE_TAG, locale);
 
     return CanonicalizeLanguageTag(locale);
 }
 
-
 function localeContainsNoUnicodeExtensions(locale) {
     // No "-u-", no possible Unicode extension.
     if (callFunction(std_String_indexOf, locale, "-u-") === -1)
         return true;
 
     // "-u-" within privateuse also isn't one.
     if (callFunction(std_String_indexOf, locale, "-u-") > callFunction(std_String_indexOf, locale, "-x-"))
         return true;
@@ -568,53 +529,48 @@ function localeContainsNoUnicodeExtensio
     // An entirely-privateuse tag doesn't contain extensions.
     if (callFunction(std_String_startsWith, locale, "x-"))
         return true;
 
     // Otherwise, we have a Unicode extension sequence.
     return false;
 }
 
-
 // The last-ditch locale is used if none of the available locales satisfies a
 // request. "en-GB" is used based on the assumptions that English is the most
 // common second language, that both en-GB and en-US are normally available in
 // an implementation, and that en-GB is more representative of the English used
 // in other locales.
 function lastDitchLocale() {
     // Per bug 1177929, strings don't clone out of self-hosted code as atoms,
     // breaking IonBuilder::constant.  Put this in a function for now.
     return "en-GB";
 }
 
-
 // Certain old, commonly-used language tags that lack a script, are expected to
 // nonetheless imply one.  This object maps these old-style tags to modern
 // equivalents.
 var oldStyleLanguageTagMappings = {
     "pa-PK": "pa-Arab-PK",
     "zh-CN": "zh-Hans-CN",
     "zh-HK": "zh-Hant-HK",
     "zh-SG": "zh-Hans-SG",
     "zh-TW": "zh-Hant-TW",
 };
 
-
 var localeCandidateCache = {
     runtimeDefaultLocale: undefined,
     candidateDefaultLocale: undefined,
 };
 
-
 var localeCache = {
     runtimeDefaultLocale: undefined,
     defaultLocale: undefined,
 };
 
-
 /**
  * Compute the candidate default locale: the locale *requested* to be used as
  * the default locale.  We'll use it if and only if ICU provides support (maybe
  * fallback support, e.g. supporting "de-ZA" through "de" support implied by a
  * "de-DE" locale).
  */
 function DefaultLocaleIgnoringAvailableLocales() {
     const runtimeDefaultLocale = RuntimeDefaultLocale();
@@ -645,17 +601,16 @@ function DefaultLocaleIgnoringAvailableL
     assert(IsStructurallyValidLanguageTag(candidate),
            "the candidate must be structurally valid");
     assert(localeContainsNoUnicodeExtensions(candidate),
            "the candidate must not contain a Unicode extension sequence");
 
     return candidate;
 }
 
-
 /**
  * Returns the BCP 47 language tag for the host environment's current locale.
  *
  * Spec: ECMAScript Internationalization API Specification, 6.2.4.
  */
 function DefaultLocale() {
     if (IsRuntimeDefaultLocale(localeCache.runtimeDefaultLocale))
         return localeCache.defaultLocale;
@@ -689,17 +644,16 @@ function DefaultLocale() {
            "the computed default locale must not contain a Unicode extension sequence");
 
     localeCache.defaultLocale = locale;
     localeCache.runtimeDefaultLocale = runtimeDefaultLocale;
 
     return locale;
 }
 
-
 /**
  * Verifies that the given string is a well-formed ISO 4217 currency code.
  *
  * Spec: ECMAScript Internationalization API Specification, 6.3.1.
  */
 function getIsWellFormedCurrencyCodeRE() {
     return internalIntlRegExps.isWellFormedCurrencyCodeRE ||
            (internalIntlRegExps.isWellFormedCurrencyCodeRE = RegExpCreate("[^A-Z]"));
@@ -707,23 +661,21 @@ function getIsWellFormedCurrencyCodeRE()
 function IsWellFormedCurrencyCode(currency) {
     var c = ToString(currency);
     var normalized = toASCIIUpperCase(c);
     if (normalized.length !== 3)
         return false;
     return !regexp_test_no_statics(getIsWellFormedCurrencyCodeRE(), normalized);
 }
 
-
 var timeZoneCache = {
     icuDefaultTimeZone: undefined,
     defaultTimeZone: undefined,
 };
 
-
 /**
  * 6.4.2 CanonicalizeTimeZoneName ( timeZone )
  *
  * Canonicalizes the given IANA time zone name.
  *
  * ES2017 Intl draft rev 4a23f407336d382ed5e3471200c690c9b020b5f3
  */
 function CanonicalizeTimeZoneName(timeZone) {
@@ -747,17 +699,16 @@ function CanonicalizeTimeZoneName(timeZo
         else
             ianaTimeZone = "UTC";
     }
 
     // Step 4.
     return ianaTimeZone;
 }
 
-
 /**
  * 6.4.3 DefaultTimeZone ()
  *
  * Returns the IANA time zone name for the host environment's current time zone.
  *
  * ES2017 Intl draft rev 4a23f407336d382ed5e3471200c690c9b020b5f3
  */
 function DefaultTimeZone() {
@@ -794,17 +745,16 @@ function DefaultTimeZone() {
     var defaultTimeZone = CanonicalizeTimeZoneName(timeZone);
 
     timeZoneCache.defaultTimeZone = defaultTimeZone;
     timeZoneCache.icuDefaultTimeZone = icuDefaultTimeZone;
 
     return defaultTimeZone;
 }
 
-
 /********** Locale and Parameter Negotiation **********/
 
 /**
  * Add old-style language tags without script code for locales that in current
  * usage would include a script subtag.  Also add an entry for the last-ditch
  * locale, in case ICU doesn't directly support it (but does support it through
  * fallback, e.g. supporting "en-GB" indirectly using "en" support).
  */
@@ -821,17 +771,16 @@ function addSpecialMissingLanguageTags(a
     // Also forcibly provide the last-ditch locale.
     var lastDitch = lastDitchLocale();
     assert(lastDitch === "en-GB" && availableLocales.en,
            "shouldn't be a need to add every locale implied by the last-" +
            "ditch locale, merely just the last-ditch locale");
     availableLocales[lastDitch] = true;
 }
 
-
 /**
  * Canonicalizes a locale list.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.1.
  */
 function CanonicalizeLocaleList(locales) {
     if (locales === undefined)
         return [];
@@ -858,17 +807,16 @@ function CanonicalizeLocaleList(locales)
             if (callFunction(ArrayIndexOf, seen, tag) === -1)
                 _DefineDataProperty(seen, seen.length, tag);
         }
         k++;
     }
     return seen;
 }
 
-
 function BestAvailableLocaleHelper(availableLocales, locale, considerDefaultLocale) {
     assert(IsStructurallyValidLanguageTag(locale), "invalid BestAvailableLocale locale structure");
     assert(locale === CanonicalizeLanguageTag(locale), "non-canonical BestAvailableLocale locale");
     assert(localeContainsNoUnicodeExtensions(locale), "locale must contain no Unicode extensions");
 
     // In the spec, [[availableLocales]] is formally a list of all available
     // locales.  But in our implementation, it's an *incomplete* list, not
     // necessarily including the default locale (and all locales implied by it,
@@ -902,39 +850,36 @@ function BestAvailableLocaleHelper(avail
 
         if (pos >= 2 && candidate[pos - 2] === "-")
             pos -= 2;
 
         candidate = callFunction(String_substring, candidate, 0, pos);
     }
 }
 
-
 /**
  * Compares a BCP 47 language tag against the locales in availableLocales
  * and returns the best available match. Uses the fallback
  * mechanism of RFC 4647, section 3.4.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.2.
  * Spec: RFC 4647, section 3.4.
  */
 function BestAvailableLocale(availableLocales, locale) {
     return BestAvailableLocaleHelper(availableLocales, locale, true);
 }
 
-
 /**
  * Identical to BestAvailableLocale, but does not consider the default locale
  * during computation.
  */
 function BestAvailableLocaleIgnoringDefault(availableLocales, locale) {
     return BestAvailableLocaleHelper(availableLocales, locale, false);
 }
 
-
 /**
  * Compares a BCP 47 language priority list against the set of locales in
  * availableLocales and determines the best available language to meet the
  * request. Options specified through Unicode extension subsequences are
  * ignored in the lookup, but information about such subsequences is returned
  * separately.
  *
  * This variant is based on the Lookup algorithm of RFC 4647 section 3.4.
@@ -963,32 +908,30 @@ function LookupMatcher(availableLocales,
             result.extension = extensionMatch[0];
         }
     } else {
         result.locale = DefaultLocale();
     }
     return result;
 }
 
-
 /**
  * Compares a BCP 47 language priority list against the set of locales in
  * availableLocales and determines the best available language to meet the
  * request. Options specified through Unicode extension subsequences are
  * ignored in the lookup, but information about such subsequences is returned
  * separately.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.4.
  */
 function BestFitMatcher(availableLocales, requestedLocales) {
     // this implementation doesn't have anything better
     return LookupMatcher(availableLocales, requestedLocales);
 }
 
-
 /**
  * Returns the Unicode extension value subtags for the requested key subtag.
  *
  * NOTE: PR to add UnicodeExtensionValue to ECMA-402 isn't yet written.
  */
 function UnicodeExtensionValue(extension, key) {
     assert(typeof extension === "string", "extension is a string value");
     assert(function() {
@@ -1051,17 +994,16 @@ function UnicodeExtensionValue(extension
 
     // Steps 6-7.
     if (callFunction(std_String_endsWith, extension, searchValue))
         return "";
 
     // Step 8 (implicit).
 }
 
-
 /**
  * Compares a BCP 47 language priority list against availableLocales and
  * determines the best available language to meet the request. Options specified
  * through Unicode extension subsequences are negotiated separately, taking the
  * caller's relevant extensions and locale data as well as client-provided
  * options into consideration.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.5.
@@ -1196,17 +1138,16 @@ function ResolveLocale(availableLocales,
 
     // Step 14.
     result.locale = foundLocale;
 
     // Step 15.
     return result;
 }
 
-
 /**
  * Returns the subset of requestedLocales for which availableLocales has a
  * matching (possibly fallback) locale. Locales appear in the same order in the
  * returned list as in the input list.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.6.
  */
 function LookupSupportedLocales(availableLocales, requestedLocales) {
@@ -1229,30 +1170,28 @@ function LookupSupportedLocales(availabl
         // Step 4.e.
         k++;
     }
 
     // Steps 5-6.
     return subset;
 }
 
-
 /**
  * Returns the subset of requestedLocales for which availableLocales has a
  * matching (possibly fallback) locale. Locales appear in the same order in the
  * returned list as in the input list.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.7.
  */
 function BestFitSupportedLocales(availableLocales, requestedLocales) {
     // don't have anything better
     return LookupSupportedLocales(availableLocales, requestedLocales);
 }
 
-
 /**
  * Returns the subset of requestedLocales for which availableLocales has a
  * matching (possibly fallback) locale. Locales appear in the same order in the
  * returned list as in the input list.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.8.
  */
 function SupportedLocales(availableLocales, requestedLocales, options) {
@@ -1285,17 +1224,16 @@ function SupportedLocales(availableLocal
     }
     _DefineDataProperty(subset, "length", subset.length,
                         ATTR_NONENUMERABLE | ATTR_NONCONFIGURABLE | ATTR_NONWRITABLE);
 
     // Step 5.
     return subset;
 }
 
-
 /**
  * Extracts a property value from the provided options object, converts it to
  * the required type, checks whether it is one of a list of allowed values,
  * and fills in a fallback value if necessary.
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.9.
  */
 function GetOption(options, property, type, values, fallback) {
@@ -1359,20 +1297,18 @@ function DefaultNumberOption(value, mini
  *
  * Spec: ECMAScript Internationalization API Specification, 9.2.12.
  */
 function GetNumberOption(options, property, minimum, maximum, fallback) {
     // Steps 1-3.
     return DefaultNumberOption(options[property], minimum, maximum, fallback);
 }
 
-
 /********** Property access for Intl objects **********/
 
-
 // Symbols in the self-hosting compartment can't be cloned, use a separate
 // object to hold the actual symbol value.
 // TODO: Can we add support to clone symbols?
 var intlFallbackSymbolHolder = { value: undefined };
 
 /**
  * The [[FallbackSymbol]] symbol of the %Intl% intrinsic object.
  *
@@ -1383,17 +1319,16 @@ function intlFallbackSymbol() {
     var fallbackSymbol = intlFallbackSymbolHolder.value;
     if (!fallbackSymbol) {
         fallbackSymbol = std_Symbol("IntlLegacyConstructedSymbol");
         intlFallbackSymbolHolder.value = fallbackSymbol;
     }
     return fallbackSymbol;
 }
 
-
 /**
  * Initializes the INTL_INTERNALS_OBJECT_SLOT of the given object.
  */
 function initializeIntlObject(obj, type, lazyData) {
     assert(IsObject(obj), "Non-object passed to initializeIntlObject");
     assert((type === "Collator" && IsCollator(obj)) ||
            (type === "DateTimeFormat" && IsDateTimeFormat(obj)) ||
            (type === "NumberFormat" && IsNumberFormat(obj)) ||
@@ -1421,45 +1356,42 @@ function initializeIntlObject(obj, type,
     internals.lazyData = lazyData;
     internals.internalProps = null;
 
     assert(UnsafeGetReservedSlot(obj, INTL_INTERNALS_OBJECT_SLOT) === null,
            "Internal slot already initialized?");
     UnsafeSetReservedSlot(obj, INTL_INTERNALS_OBJECT_SLOT, internals);
 }
 
-
 /**
  * Set the internal properties object for an |internals| object previously
  * associated with lazy data.
  */
 function setInternalProperties(internals, internalProps) {
     assert(IsObject(internals.lazyData), "lazy data must exist already");
     assert(IsObject(internalProps), "internalProps argument should be an object");
 
     // Set in reverse order so that the .lazyData nulling is a barrier.
     internals.internalProps = internalProps;
     internals.lazyData = null;
 }
 
-
 /**
  * Get the existing internal properties out of a non-newborn |internals|, or
  * null if none have been computed.
  */
 function maybeInternalProperties(internals) {
     assert(IsObject(internals), "non-object passed to maybeInternalProperties");
     var lazyData = internals.lazyData;
     if (lazyData)
         return null;
     assert(IsObject(internals.internalProps), "missing lazy data and computed internals");
     return internals.internalProps;
 }
 
-
 /**
  * Return |obj|'s internals object (*not* the object holding its internal
  * properties!), with structure specified above.
  *
  * Spec: ECMAScript Internationalization API Specification, 10.3.
  * Spec: ECMAScript Internationalization API Specification, 11.3.
  * Spec: ECMAScript Internationalization API Specification, 12.3.
  */
@@ -1481,17 +1413,16 @@ function getIntlObjectInternals(obj) {
            (internals.type === "RelativeTimeFormat" && IsRelativeTimeFormat(obj)),
            "type must match the object's class");
     assert(hasOwn("lazyData", internals), "missing lazyData");
     assert(hasOwn("internalProps", internals), "missing internalProps");
 
     return internals;
 }
 
-
 /**
  * Get the internal properties of known-Intl object |obj|.  For use only by
  * C++ code that knows what it's doing!
  */
 function getInternals(obj) {
     var internals = getIntlObjectInternals(obj);
 
     // If internal properties have already been computed, use them.
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -740,18 +740,18 @@ selfhosted.inputs = [
     'builtin/Utilities.js',
     'builtin/Array.js',
     'builtin/AsyncIteration.js',
     'builtin/Classes.js',
     'builtin/Date.js',
     'builtin/Error.js',
     'builtin/Function.js',
     'builtin/Generator.js',
-    'builtin/Intl.js',
     'builtin/intl/Collator.js',
+    'builtin/intl/CommonFunctions.js',
     'builtin/intl/CurrencyDataGenerated.js',
     'builtin/intl/DateTimeFormat.js',
     'builtin/intl/IntlObject.js',
     'builtin/intl/LangTagMappingsGenerated.js',
     'builtin/intl/NumberFormat.js',
     'builtin/intl/PluralRules.js',
     'builtin/intl/RelativeTimeFormat.js',
     'builtin/Iterator.js',