This website works better with JavaScript.
Home
Explore
Help
Sign In
RuhNetConsulting
/
libphonenumber
mirror of
https://github.com/google/libphonenumber
Watch
1
Star
1
Fork
0
Code
Issues
0
Projects
0
Releases
254
Wiki
Activity
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
1adb9b763e
commit
b86c00ff95
3 changed files
with
6 additions
and
6 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-3
javascript/i18n/phonenumbers/phonenumberutil.js
+3
-3
javascript/i18n/phonenumbers/phonenumberutil_test.js
+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'
,
Write
Preview
Loading…
Cancel
Save