Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace let/const with var #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions PhoneNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ var PhoneNumber = (function (dataBase) {
// Use strict in our context only - users might not want it
'use strict';

const MAX_PHONE_NUMBER_LENGTH = 50;
const NON_ALPHA_CHARS = /[^a-zA-Z]/g;
const NON_DIALABLE_CHARS = /[^,#+\*\d]/g;
const NON_DIALABLE_CHARS_ONCE = new RegExp(NON_DIALABLE_CHARS.source);
const BACKSLASH = /\\/g;
const SPLIT_FIRST_GROUP = /^(\d+)(.*)$/;
const LEADING_PLUS_CHARS_PATTERN = /^[+\uFF0B]+/g;
var MAX_PHONE_NUMBER_LENGTH = 50;
var NON_ALPHA_CHARS = /[^a-zA-Z]/g;
var NON_DIALABLE_CHARS = /[^,#+\*\d]/g;
var NON_DIALABLE_CHARS_ONCE = new RegExp(NON_DIALABLE_CHARS.source);
var BACKSLASH = /\\/g;
var SPLIT_FIRST_GROUP = /^(\d+)(.*)$/;
var LEADING_PLUS_CHARS_PATTERN = /^[+\uFF0B]+/g;

// Format of the string encoded meta data. If the name contains "^" or "$"
// we will generate a regular expression from the value, with those special
// characters as prefix/suffix.
const META_DATA_ENCODING = ["region",
var META_DATA_ENCODING = ["region",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure const is not supported? or is it just let? If you want to change this please also adjust the indentation below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const isn't supported in E10

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE10? Who uses that? ;) Ok, please fix the indentation and I will merge it.

"^(?:internationalPrefix)",
"nationalPrefix",
"^(?:nationalPrefixForParsing)",
Expand All @@ -26,7 +26,7 @@ var PhoneNumber = (function (dataBase) {
"^nationalPattern$",
"formats"];

const FORMAT_ENCODING = ["^pattern$",
var FORMAT_ENCODING = ["^pattern$",
"nationalFormat",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

"^leadingDigits",
"nationalPrefixFormattingRule",
Expand Down Expand Up @@ -106,8 +106,8 @@ var PhoneNumber = (function (dataBase) {
// the formats field from the main country.
if (typeof entry[0] == "string")
entry[0] = ParseMetaData(countryCode, entry[0]);
let formats = entry[0].formats;
let current = ParseMetaData(countryCode, entry[n]);
var formats = entry[0].formats;
var current = ParseMetaData(countryCode, entry[n]);
current.formats = formats;
return entry[n] = current;
}
Expand Down
8 changes: 4 additions & 4 deletions PhoneNumberNormalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */

var PhoneNumberNormalizer = (function() {
const UNICODE_DIGITS = /[\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]/g;
const VALID_ALPHA_PATTERN = /[a-zA-Z]/g;
const LEADING_PLUS_CHARS_PATTERN = /^[+\uFF0B]+/g;
const NON_DIALABLE_CHARS = /[^,#+\*\d]/g;
var UNICODE_DIGITS = /[\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]/g;
var VALID_ALPHA_PATTERN = /[a-zA-Z]/g;
var LEADING_PLUS_CHARS_PATTERN = /^[+\uFF0B]+/g;
var NON_DIALABLE_CHARS = /[^,#+\*\d]/g;

// Map letters to numbers according to the ITU E.161 standard
var E161 = {
Expand Down
2 changes: 1 addition & 1 deletion xml2meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def format(x):
print(example)
sys.exit()

print("const PHONE_NUMBER_META_DATA = {");
print("var PHONE_NUMBER_META_DATA = {");
for cc in map:
entry = map[cc]
if len(entry) > 1:
Expand Down