зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1382529 - [Form Autofill] Exception occurs when saving a telephone number like "1234567". r=steveck
MozReview-Commit-ID: mJ3KJemnme --HG-- extra : rebase_source : c4a7b2e5273bac8d941bd558adc49aced331b2e6
This commit is contained in:
Родитель
72cfd0cddb
Коммит
f9ed9e0c01
|
@ -1341,7 +1341,7 @@ class Addresses extends AutofillRecords {
|
|||
}
|
||||
|
||||
let tel = PhoneNumber.Parse(number, region);
|
||||
if (tel) {
|
||||
if (tel && tel.internationalNumber) {
|
||||
// Force to save numbers in E.164 format if parse success.
|
||||
address.tel = tel.internationalNumber;
|
||||
} else if (!address.tel) {
|
||||
|
|
|
@ -390,6 +390,15 @@ const ADDRESS_NORMALIZE_TESTCASES = [
|
|||
"tel": "12345",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Has a valid tel-local format \"tel\"",
|
||||
address: {
|
||||
"tel": "1234567",
|
||||
},
|
||||
expectedResult: {
|
||||
"tel": "1234567",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Has \"tel-national\" and \"tel-country-code\"",
|
||||
address: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче