Browse Source

JS: Fix some compiler issues. Add missing ReginoCode.CH in regioncodefortesting.js. Change visibility of isNumberGeographical to public so that it can be accessed from tests.

Review URL: https://codereview.appspot.com/8649050
pull/567/head
Nikolaos Trogkanis 13 years ago
committed by Mihaela Rosca
parent
commit
b86c00ff95
3 changed files with 6 additions and 6 deletions
  1. +2
    -3
      javascript/i18n/phonenumbers/phonenumberutil.js
  2. +3
    -3
      javascript/i18n/phonenumbers/phonenumberutil_test.js
  3. +1
    -0
      javascript/i18n/phonenumbers/regioncodefortesting.js

+ 2
- 3
javascript/i18n/phonenumbers/phonenumberutil.js View File

@ -1138,7 +1138,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.getLengthOfGeographicalAreaCode =
return 0;
}
if (!this.isNumberGeographical_(number)) {
if (!this.isNumberGeographical(number)) {
return 0;
}
@ -1296,9 +1296,8 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formattingRuleHasFirstGroupOnly =
*
* @param {i18n.phonenumbers.PhoneNumber} phoneNumber The phone number to test.
* @return {boolean} true if the phone number has a geographical association.
* @private
*/
i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberGeographical_ =
i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberGeographical =
function(phoneNumber) {
/** @type {i18n.phonenumbers.PhoneNumberType} */
var numberType = this.getNumberType(phoneNumber);


+ 3
- 3
javascript/i18n/phonenumbers/phonenumberutil_test.js View File

@ -318,11 +318,11 @@ function testGetInstanceLoadInternationalTollFreeMetadata() {
function testIsNumberGeographical() {
// Bahamas, mobile phone number.
assertFalse(phoneUtil.isNumberGeographical_(BS_MOBILE));
assertFalse(phoneUtil.isNumberGeographical(BS_MOBILE));
// Australian fixed line number.
assertTrue(phoneUtil.isNumberGeographical_(AU_NUMBER));
assertTrue(phoneUtil.isNumberGeographical(AU_NUMBER));
// International toll free number.
assertFalse(phoneUtil.isNumberGeographical_(INTERNATIONAL_TOLL_FREE));
assertFalse(phoneUtil.isNumberGeographical(INTERNATIONAL_TOLL_FREE));
}
function testIsLeadingZeroPossible() {


+ 1
- 0
javascript/i18n/phonenumbers/regioncodefortesting.js View File

@ -41,6 +41,7 @@ i18n.phonenumbers.RegionCode = {
BS: 'BS',
BY: 'BY',
CA: 'CA',
CH: 'CH',
CN: 'CN',
CS: 'CS',
DE: 'DE',


Loading…
Cancel
Save