src/third_party/mozjs/extract/js/src/builtin/intl/CommonFunctions.js
/**
 * 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.9.
 */
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.

ECMAScript Internationalization API Specification, 9.2.9.
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 . ECMAScript Internationalization API Specification 9 . 2 . 9 .
function SupportedLocales(availableLocales, requestedLocales, options) {
    var matcher;
    if (options !== undefined) {
        a.
        options = ToObject(options);
        b
        matcher = options.localeMatcher;
        if (matcher !== undefined) {
            matcher = ToString(matcher);
            if (matcher !== "lookup" && matcher !== "best fit")
                ThrowRangeError(JSMSG_INVALID_LOCALE_MATCHER, matcher);
        }
    }
    return (matcher === undefined || matcher === "best fit")
           ? BestFitSupportedLocales(availableLocales, requestedLocales)
           : LookupSupportedLocales(availableLocales, requestedLocales);
}
function SupportedLocales ( availableLocales , requestedLocales , options ) { var matcher ; if ( options !== undefined ) { options = ToObject ( options ) ; matcher = options . localeMatcher ; if ( matcher !== undefined ) { matcher = ToString ( matcher ) ; if ( matcher !== "lookup" && matcher !== "best fit" ) ThrowRangeError ( JSMSG_INVALID_LOCALE_MATCHER , matcher ) ; } } return ( matcher === undefined || matcher === "best fit" ) ? BestFitSupportedLocales ( availableLocales , requestedLocales ) : LookupSupportedLocales ( availableLocales , requestedLocales ) ; }
Returns the subset of requestedLocales for which availableLocales has a
 matching (possibly fallback) locale.
Returns the subset of requestedLocales for which availableLocales has a matching ( possibly fallback ) locale .
// Step 1. // Step 1.a. // Step 1.b // Steps 2-5.