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.7.
 */
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.7.
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 . 7 .
function LookupSupportedLocales(availableLocales, requestedLocales) {
    var subset = [];
    for (var i = 0; i < requestedLocales.length; i++) {
        var locale = requestedLocales[i];
        a.
        var noExtensionsLocale = removeUnicodeExtensions(locale);
        b.
        var availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale);
        c.
        if (availableLocale !== undefined)
            DefineDataProperty(subset, subset.length, locale);
    }
    return subset;
}
function LookupSupportedLocales ( availableLocales , requestedLocales ) { var subset = [ ] ; for ( var i = 0 ; i < requestedLocales . length ; i ++ ) { var locale = requestedLocales [ i ] ; var noExtensionsLocale = removeUnicodeExtensions ( locale ) ; var availableLocale = BestAvailableLocale ( availableLocales , noExtensionsLocale ) ; if ( availableLocale !== undefined ) DefineDataProperty ( subset , subset . length , locale ) ; } return subset ; }
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 2. // Step 2.a. // Step 2.b. // Step 2.c. // Step 3.