Porting same changes to JS
diff --git a/javascript/i18n/phonenumbers/phonenumberutil.js b/javascript/i18n/phonenumbers/phonenumberutil.js index c52279d..808b11e 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil.js +++ b/javascript/i18n/phonenumbers/phonenumberutil.js
@@ -1935,16 +1935,6 @@ // carriers won't connect the call. Because of that, we return an // empty string here. ''; - } else if (isValidNumber && regionCode == 'HU') { - // The national format for HU numbers doesn't contain the national prefix, - // because that is how numbers are normally written down. However, the - // national prefix is obligatory when dialing from a mobile phone. As a - // result, we add it back here if it is a valid regular length phone - // number. - formattedNumber = - this.getNddPrefixForRegion(regionCode, true /* strip non-digits */) + - ' ' + this.format(numberNoExt, - i18n.phonenumbers.PhoneNumberFormat.NATIONAL); } else if (countryCallingCode == i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_) { // For NANPA countries, we output international format for numbers that
diff --git a/javascript/i18n/phonenumbers/phonenumberutil_test.js b/javascript/i18n/phonenumbers/phonenumberutil_test.js index b0d9e6d..69b2e34 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil_test.js +++ b/javascript/i18n/phonenumbers/phonenumberutil_test.js
@@ -1196,28 +1196,6 @@ phoneUtil.formatNumberForMobileDialing(deShortNumber, RegionCode.IT, false)); - // Test the special logic for Hungary, where the national prefix must be added - // before dialing from a mobile phone for regular length numbers, but not for - // short numbers. - var huRegularNumber = new i18n.phonenumbers.PhoneNumber(); - huRegularNumber.setCountryCode(36); - huRegularNumber.setNationalNumber(301234567); - assertEquals('06301234567', - phoneUtil.formatNumberForMobileDialing(huRegularNumber, - RegionCode.HU, false)); - assertEquals('+36301234567', - phoneUtil.formatNumberForMobileDialing(huRegularNumber, - RegionCode.JP, false)); - var huShortNumber = new i18n.phonenumbers.PhoneNumber(); - huShortNumber.setCountryCode(36); - huShortNumber.setNationalNumber(104); - assertEquals('104', - phoneUtil.formatNumberForMobileDialing(huShortNumber, - RegionCode.HU, false)); - assertEquals('', - phoneUtil.formatNumberForMobileDialing(huShortNumber, - RegionCode.JP, false)); - // Test the special logic for NANPA countries, for which regular length phone // numbers are always output in international format, but short numbers are in // national format.