src/third_party/v8-3.25/src/i18n.js
/**
 * Returns an array where all locales are canonicalized and duplicates removed.
 * Throws on locales that are not well formed BCP47 tags.
 */
Returns an array where all locales are canonicalized and duplicates removed.
Throws on locales that are not well formed BCP47 tags.
Returns an array where all locales are canonicalized and duplicates removed . Throws on locales that are not well formed BCP47 tags .
function initializeLocaleList(locales) {
  var seen = [];
  if (locales === undefined) {
    seen = [];
  } else {
    if (typeof locales === 'string') {
      seen.push(canonicalizeLanguageTag(locales));
      return freezeArray(seen);
    }
    var o = toObject(locales);
    var len = o.length >>> 0;
    for (var k = 0; k < len; k++) {
      if (k in o) {
        var value = o[k];
        var tag = canonicalizeLanguageTag(value);
        if (seen.indexOf(tag) === -1) {
          seen.push(tag);
        }
      }
    }
  }
  return freezeArray(seen);
}
function initializeLocaleList ( locales ) { var seen = [ ] ; if ( locales === undefined ) { seen = [ ] ; } else { if ( typeof locales === 'string' ) { seen . push ( canonicalizeLanguageTag ( locales ) ) ; return freezeArray ( seen ) ; } var o = toObject ( locales ) ; var len = o . length >>> 0 ; for ( var k = 0 ; k < len ; k ++ ) { if ( k in o ) { var value = o [ k ] ; var tag = canonicalizeLanguageTag ( value ) ; if ( seen . indexOf ( tag ) === - 1 ) { seen . push ( tag ) ; } } } } return freezeArray ( seen ) ; }
Returns an array where all locales are canonicalized and duplicates removed.
Returns an array where all locales are canonicalized and duplicates removed .
// Constructor is called without arguments. // We allow single string localeID. // Converts it to UInt32 (>>> is shr on 32bit integers).