Browse Source

JS: update confusing var name.

pull/567/head
Shaopeng Jia 15 years ago
committed by Mihaela Rosca
parent
commit
bdab8b2ced
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      javascript/i18n/phonenumbers/phonenumberutil.js

+ 7
- 4
javascript/i18n/phonenumbers/phonenumberutil.js View File

@ -468,11 +468,13 @@ i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ = '+\uFF0B';
/**
* This corresponds to the PLUS_CHARS_PATTERN in Java.
*
* @const
* @type {!RegExp}
* @private
*/
i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_PATTERN_ =
i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_ =
new RegExp('^[' + i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ + ']+');
@ -2726,9 +2728,10 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.
return i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY;
}
// Check to see if the number begins with one or more plus signs.
if (i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_PATTERN_.test(numberStr)) {
if (i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_
.test(numberStr)) {
numberStr = numberStr.replace(
i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_PATTERN_, '');
i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_, '');
// Can now normalize the rest of the number since we've consumed the '+'
// sign at the start.
number.clear();
@ -2879,7 +2882,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.checkRegionForParsing_ = function(
// If the number is null or empty, we can't infer the region.
return this.isValidRegionCode_(defaultRegion) ||
(numberToParse != null && numberToParse.length > 0 &&
i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_PATTERN_.test(
i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_.test(
numberToParse));
};


Loading…
Cancel
Save