src/third_party/mozjs/extract/js/src/builtin/intl/CommonFunctions.js
/**
 * Returns the start index of a "Unicode locale extension sequence", which the
 * specification defines as: "any substring of a language tag that starts with
 * a separator '-' and the singleton 'u' and includes the maximum sequence of
 * following non-singleton subtags and their preceding '-' separators."
 *
 * Alternatively, this may be defined as: the components of a language tag that
 * match the `unicode_locale_extensions` production in UTS 35.
 *
 * Spec: ECMAScript Internationalization API Specification, 6.2.1.
 */


Alternatively, this may be defined as: the components of a language tag that
match the `unicode_locale_extensions` production in UTS 35.

ECMAScript Internationalization API Specification, 6.2.1.
Alternatively this may be defined as : the components of a language tag that match the ` unicode_locale_extensions ` production in UTS 35 . ECMAScript Internationalization API Specification 6 . 2 . 1 .
function startOfUnicodeExtensions(locale) {
    assert(typeof locale === "string", "locale is a string");
    var start = callFunction(std_String_indexOf, locale, "-u-");
    if (start < 0)
        return -1;
    var privateExt = callFunction(std_String_indexOf, locale, "-x-");
    if (privateExt >= 0 && privateExt < start)
        return -1;
    return start;
}
function startOfUnicodeExtensions ( locale ) { assert ( typeof locale === "string" , "locale is a string" ) ; var start = callFunction ( std_String_indexOf , locale , "-u-" ) ; if ( start < 0 ) return - 1 ; var privateExt = callFunction ( std_String_indexOf , locale , "-x-" ) ; if ( privateExt >= 0 && privateExt < start ) return - 1 ; return start ; }
Returns the start index of a "Unicode locale extension sequence", which the
 specification defines as: "any substring of a language tag that starts with
 a separator '-' and the singleton 'u' and includes the maximum sequence of
 following non-singleton subtags and their preceding '-' separators."
Returns the start index of a " Unicode locale extension sequence " which the specification defines as : " any substring of a language tag that starts with a separator ' - ' and the singleton ' u ' and includes the maximum sequence of following non - singleton subtags and their preceding ' - ' separators . "
// Search for "-u-" marking the start of a Unicode extension sequence. // And search for "-x-" marking the start of any privateuse component to // handle the case when "-u-" was only found within a privateuse subtag.