B2G/gecko/dom/phonenumberutils/PhoneNumber.jsm
// null if the number is not a valid international number.
null if the number is not a valid international number.
null if the number is not a valid international number .
function ParseInternationalNumber(number) {
    var ret;
    var countryCode = ParseCountryCode(number);
    if (!countryCode)
      return null;
    number = number.substr(countryCode.length);
    var entry = dataBase[countryCode];
    if (Array.isArray(entry)) {
      for (var n = 0; n < entry.length; ++n) {
        if (typeof entry[n] == "string")
          entry[n] = ParseMetaData(countryCode, entry[n]);
        if (n > 0)
          entry[n].formats = entry[0].formats;
        if (ret = ParseNationalNumber(number, entry[n]))
          return ret;
      }
      return null;
    }
    if (typeof entry == "string")
      entry = dataBase[countryCode] = ParseMetaData(countryCode, entry);
    return ParseNationalNumber(number, entry);
  }
function ParseInternationalNumber ( number ) { var ret ; var countryCode = ParseCountryCode ( number ) ; if ( ! countryCode ) return null ; number = number . substr ( countryCode . length ) ; var entry = dataBase [ countryCode ] ; if ( Array . isArray ( entry ) ) { for ( var n = 0 ; n < entry . length ; ++ n ) { if ( typeof entry [ n ] == "string" ) entry [ n ] = ParseMetaData ( countryCode , entry [ n ] ) ; if ( n > 0 ) entry [ n ] . formats = entry [ 0 ] . formats ; if ( ret = ParseNationalNumber ( number , entry [ n ] ) ) return ret ; } return null ; } if ( typeof entry == "string" ) entry = dataBase [ countryCode ] = ParseMetaData ( countryCode , entry ) ; return ParseNationalNumber ( number , entry ) ; }
null if the number is not a valid international number.
null if the number is not a valid international number .
// Parse and strip the country code. // Lookup the meta data for the region (or regions) and if the rest of // the number parses for that region, return the parsed number.