JS: Fix some compiler issues. Add missing ReginoCode.CH in regioncodefortesting.js...
authortronikos <tronikos@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 23 Apr 2013 07:36:38 +0000 (07:36 +0000)
committertronikos <tronikos@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 23 Apr 2013 07:36:38 +0000 (07:36 +0000)
Review URL: https://codereview.appspot.com/8649050

git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@564 ee073f10-1060-11df-b6a4-87a95322a99c

javascript/i18n/phonenumbers/phonenumberutil.js
javascript/i18n/phonenumbers/phonenumberutil_test.js
javascript/i18n/phonenumbers/regioncodefortesting.js

index 1b7d768..a62761f 100644 (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);
index 1ee08a5..5e29a90 100644 (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() {
index 3142fad..f179605 100644 (file)
@@ -41,6 +41,7 @@ i18n.phonenumbers.RegionCode = {
   BS: 'BS',
   BY: 'BY',
   CA: 'CA',
+  CH: 'CH',
   CN: 'CN',
   CS: 'CS',
   DE: 'DE',