Skip to content

Commit

Permalink
JS: Fix some compiler issues. Add missing ReginoCode.CH in regioncode…
Browse files Browse the repository at this point in the history
…fortesting.js. Change visibility of isNumberGeographical to public so that it can be accessed from tests.

Review URL: https://codereview.appspot.com/8649050
  • Loading branch information
tronikos authored and mihaelacr-google committed Dec 3, 2014
1 parent 1adb9b7 commit b86c00f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions javascript/i18n/phonenumbers/phonenumberutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.getLengthOfGeographicalAreaCode =
return 0;
}

if (!this.isNumberGeographical_(number)) {
if (!this.isNumberGeographical(number)) {
return 0;
}

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions javascript/i18n/phonenumbers/phonenumberutil_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions javascript/i18n/phonenumbers/regioncodefortesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.phonenumbers.RegionCode = {
BS: 'BS',
BY: 'BY',
CA: 'CA',
CH: 'CH',
CN: 'CN',
CS: 'CS',
DE: 'DE',
Expand Down

0 comments on commit b86c00f

Please sign in to comment.