diff --git a/dom/phonenumberutils/PhoneNumber.jsm b/dom/phonenumberutils/PhoneNumber.jsm index 71d1e8dd36de..f1a574cc6aeb 100644 --- a/dom/phonenumberutils/PhoneNumber.jsm +++ b/dom/phonenumberutils/PhoneNumber.jsm @@ -363,17 +363,17 @@ this.PhoneNumber = (function (dataBase) { if (ret) return ret; - // If the number matches the possible numbers of the current region, - // return it as a possible number. - if (md.possiblePattern.test(number)) - return new NationalNumber(md, number); - // Now lets see if maybe its an international number after all, but // without '+' or the international prefix. ret = ParseInternationalNumber(number) if (ret) return ret; + // If the number matches the possible numbers of the current region, + // return it as a possible number. + if (md.possiblePattern.test(number)) + return new NationalNumber(md, number); + // We couldn't parse the number at all. return null; } diff --git a/dom/phonenumberutils/tests/test_phonenumber.xul b/dom/phonenumberutils/tests/test_phonenumber.xul index 7cccf50acbce..f089826eb0c0 100644 --- a/dom/phonenumberutils/tests/test_phonenumber.xul +++ b/dom/phonenumberutils/tests/test_phonenumber.xul @@ -283,6 +283,9 @@ Format("0997654321", "CL", "997654321", "CL", "(99) 765 4321", "+56 99 765 4321" // Chile mobile number from another mobile number Format("997654321", "CL", "997654321", "CL", "(99) 765 4321", "+56 99 765 4321"); +// Colombian international number without the leading "+" +Format("5712234567", "CO", "12234567", "CO", "(1) 2234567", "+57 1 2234567"); + // Dialing 911 in the US. This is not a national number. CantParse("911", "US");