src/third_party/mozjs/extract/js/src/builtin/intl/NumberFormat.js
/**
 * Verifies that the given string is a well-formed core unit identifier as
 * defined in UTS #35, Part 2, Section 6. In addition to obeying the UTS #35
 * core unit identifier syntax, |unitIdentifier| must be one of the identifiers
 * sanctioned by UTS #35 or be a compound unit composed of two sanctioned simple
 * units.
 *
 * Intl.NumberFormat Unified API Proposal
 */
Verifies that the given string is a well-formed core unit identifier as
defined in UTS #35, Part 2, Section 6. In addition to obeying the UTS #35
core unit identifier syntax, |unitIdentifier| must be one of the identifiers
sanctioned by UTS #35 or be a compound unit composed of two sanctioned simple
units.


Verifies that the given string is a well - formed core unit identifier as defined in UTS #35 Part 2 Section 6 . In addition to obeying the UTS #35 core unit identifier syntax |unitIdentifier| must be one of the identifiers sanctioned by UTS #35 or be a compound unit composed of two sanctioned simple units .
function IsWellFormedUnitIdentifier(unitIdentifier) {
    assert(typeof unitIdentifier === "string", "unitIdentifier is a string value");
    if (IsSanctionedSimpleUnitIdentifier(unitIdentifier))
        return true;
    var pos = callFunction(std_String_indexOf, unitIdentifier, "-per-");
    if (pos < 0)
        return false;
    var next = pos + "-per-".length;
    var numerator = Substring(unitIdentifier, 0, pos);
    var denominator = Substring(unitIdentifier, next, unitIdentifier.length - next);
    return IsSanctionedSimpleUnitIdentifier(numerator) &&
           IsSanctionedSimpleUnitIdentifier(denominator);
}
function IsWellFormedUnitIdentifier ( unitIdentifier ) { assert ( typeof unitIdentifier === "string" , "unitIdentifier is a string value" ) ; if ( IsSanctionedSimpleUnitIdentifier ( unitIdentifier ) ) return true ; var pos = callFunction ( std_String_indexOf , unitIdentifier , "-per-" ) ; if ( pos < 0 ) return false ; var next = pos + "-per-" . length ; var numerator = Substring ( unitIdentifier , 0 , pos ) ; var denominator = Substring ( unitIdentifier , next , unitIdentifier . length - next ) ; return IsSanctionedSimpleUnitIdentifier ( numerator ) && IsSanctionedSimpleUnitIdentifier ( denominator ) ; }
Verifies that the given string is a well-formed core unit identifier as
 defined in UTS #35, Part 2, Section 6.
Verifies that the given string is a well - formed core unit identifier as defined in UTS #35 Part 2 Section 6 .
// Step 1. // Step 2. // Steps 3 and 5. // Steps 4 and 6.