Skip to content

Commit

Permalink
removing all trailing commas to attempt to restore IE8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
caridy committed Jun 9, 2016
1 parent f42df62 commit 39180f1
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"no-console": 0,

"arrow-parens": [2, "always"],
"comma-dangle": [2, "always-multiline"],
"comma-dangle": [2, "never"],
"eqeqeq": 2,
"linebreak-style": [2, "unix"],
"prefer-arrow-callback": 2,
Expand Down
20 changes: 10 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'),

clean: {
test262: ['tmp/test262**', 'data/test262**', 'tests/test262/'],
test262: ['tmp/test262**', 'data/test262**', 'tests/test262/']
},

curl: {
test262: {
src : 'https://github.com/tc39/test262/archive/master.zip',
dest: 'tmp/test262.zip',
},
dest: 'tmp/test262.zip'
}
},

unzip: {
test262: {
src : 'tmp/test262.zip',
dest: 'tmp/',
},
dest: 'tmp/'
}
},

copy: {
Expand All @@ -31,10 +31,10 @@ module.exports = function (grunt) {
src : [
'LICENSE',
'test/intl402/**/*.js',
'harness/*.js',
],
},
},
'harness/*.js'
]
}
}

});

Expand All @@ -49,7 +49,7 @@ module.exports = function (grunt) {
'curl:test262',
'unzip:test262',
'copy:test262',
'update-tests',
'update-tests'
]);

};
8 changes: 4 additions & 4 deletions scripts/build-dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const bundleConfig = {
format: 'umd',
moduleName: 'IntlPolyfill',
sourceMap: true,
external: ['Intl'],
external: ['Intl']
};

let babelConfig = JSON.parse(fs.readFileSync('src/.babelrc', 'utf8'));
Expand All @@ -29,14 +29,14 @@ babelConfig.presets = babelConfig.presets.map((preset) => {
let plugins = [
babel(babelConfig),
commonjs({
sourceMap: true,
}),
sourceMap: true
})
];

if (isProduction) {
plugins.push(
uglify({
warnings: false,
warnings: false
})
);
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ babelConfig.presets = babelConfig.presets.map((preset) => {
let bundle = rollup({
entry: p.resolve('src/core.js'),
plugins: [
babel(babelConfig),
],
babel(babelConfig)
]
});

// Cast to native Promise.
bundle = Promise.resolve(bundle);

bundle.then(({write}) => write({
dest: p.resolve('lib/core.js'),
format: 'cjs',
format: 'cjs'
}));

process.on('unhandledRejection', (reason) => {throw reason;});
8 changes: 4 additions & 4 deletions scripts/utils/extract-calendars.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as path from 'path';
import {
getParentLocale,
hasCalendars,
normalizeLocale,
normalizeLocale
} from './locales';

export default function extractCalendars(locales) {
Expand Down Expand Up @@ -53,7 +53,7 @@ export default function extractCalendars(locales) {
// locale doesn't have relative fields, then we fallback to the "root"
// locale's fields.
calendars[locale] = {
calendars: getCalendars(resolvedLocale),
calendars: getCalendars(resolvedLocale)
};

return calendars;
Expand All @@ -74,14 +74,14 @@ function loadCalendars(locale) {
"cldr-cal-islamic-full",
"cldr-cal-japanese-full",
"cldr-cal-persian-full",
"cldr-cal-roc-full",
"cldr-cal-roc-full"
];
// walking all packages, selecting calendar files, then
// reading the content of each calendar, and concatenating the set
return pkgs.reduce((calendars, pkgName) => {
let dir = path.resolve(path.dirname(require.resolve(pkgName + '/package.json')), 'main', locale);
let filenames = glob.sync("ca-*.json", {
cwd: dir,
cwd: dir
});
return filenames.reduce((calendars, filename) => {
return Object.assign(calendars, require(path.join(dir, filename)).main[locale].dates.calendars);
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/extract-numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function extractNumbersFields(locales) {
// locale doesn't have relative fields, then we fallback to the "root"
// locale's fields.
numbers[locale] = {
numbers: getNumbers(resolvedLocale),
numbers: getNumbers(resolvedLocale)
};

return numbers;
Expand Down
6 changes: 3 additions & 3 deletions scripts/utils/locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ let PARENT_LOCALES_HASH = require('cldr-core/supplemental/parentLocales.json')
.supplemental.parentLocales.parentLocale;

let CALENDARS_LOCALES_HASH = glob.sync('*/ca-*.json', {
cwd: path.resolve(CLDR_DATES_DIR, 'main'),
cwd: path.resolve(CLDR_DATES_DIR, 'main')
}).reduce((hash, filename) => {
hash[path.dirname(filename)] = true;
return hash;
}, {});

let NUMBERS_LOCALES_HASH = glob.sync('*/numbers.json', {
cwd: path.resolve(CLDR_NUMBERS_DIR, 'main'),
cwd: path.resolve(CLDR_NUMBERS_DIR, 'main')
}).reduce((hash, filename) => {
hash[path.dirname(filename)] = true;
return hash;
}, {});

let CURRENCIES_LOCALES_HASH = glob.sync('*/currencies.json', {
cwd: path.resolve(CLDR_NUMBERS_DIR, 'main'),
cwd: path.resolve(CLDR_NUMBERS_DIR, 'main')
}).reduce((hash, filename) => {
hash[path.dirname(filename)] = true;
return hash;
Expand Down
26 changes: 13 additions & 13 deletions scripts/utils/reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function createNumberFormats (ptn) {
let patterns = ptn.split(';'),

ret = {
positivePattern: replaceSpecialChars(patterns[0]),
positivePattern: replaceSpecialChars(patterns[0])
};

// Negative patterns aren't always specified, in those cases use '-' + positivePattern
Expand Down Expand Up @@ -52,7 +52,7 @@ export default function (locale, data) {
let caMap = {
'gregorian': 'gregory',
'ethiopic-amete-alem': 'ethioaa',
'islamic-civil': 'islamicc',
'islamic-civil': 'islamicc'
};

// Default calendar is always gregorian, apparently
Expand Down Expand Up @@ -88,7 +88,7 @@ export default function (locale, data) {
hour12: !/H|k/.test(defaultTimeFormat),

formats: [],
calendars: {},
calendars: {}
},
number: {
// Numbering systems, with the default first
Expand All @@ -100,8 +100,8 @@ export default function (locale, data) {
// Symbols
symbols: {},

currencies: {},
},
currencies: {}
}
};

let ptn;
Expand All @@ -117,7 +117,7 @@ export default function (locale, data) {
plusSign: sym.plusSign,
minusSign: sym.minusSign,
percentSign: sym.percentSign,
infinity: sym.infinity,
infinity: sym.infinity
};
});

Expand Down Expand Up @@ -165,27 +165,27 @@ export default function (locale, data) {
obj.months = {
narrow: gopv(frmt.narrow),
short: gopv(frmt.abbreviated),
long: gopv(frmt.wide),
long: gopv(frmt.wide)
};
}
if ((frmt = data.calendars[cal].days) && (frmt = frmt.format)) {
obj.days = {
narrow: gopv(frmt.narrow),
short: gopv(frmt.abbreviated),
long: gopv(frmt.wide),
long: gopv(frmt.wide)
};
}
if ((frmt = data.calendars[cal].eras)) {
obj.eras = {
narrow: gopv(frmt.eraNarrow),
short: gopv(frmt.eraAbbr),
long: gopv(frmt.eraNames),
long: gopv(frmt.eraNames)
};
}
if ((frmt = data.calendars[cal].dayPeriods) && (frmt = frmt.format)) {
obj.dayPeriods = {
am: (frmt.wide || frmt.abbreviated).am,
pm: (frmt.wide || frmt.abbreviated).pm,
pm: (frmt.wide || frmt.abbreviated).pm
};
}

Expand All @@ -195,7 +195,7 @@ export default function (locale, data) {
yMMMMEEEEd: defCa.dateFormats.full,
yMMMMd: defCa.dateFormats.long,
yMMMd: defCa.dateFormats.medium,
yMd: defCa.dateFormats.short,
yMd: defCa.dateFormats.short
};

// Basic Time Formats
Expand All @@ -204,7 +204,7 @@ export default function (locale, data) {
hmmsszzzz: defCa.timeFormats.full,
hmsz: defCa.timeFormats.long,
hms: defCa.timeFormats.medium,
hm: defCa.timeFormats.short,
hm: defCa.timeFormats.short
};

ret.date.formats = {
Expand All @@ -214,7 +214,7 @@ export default function (locale, data) {
long: defCa.dateTimeFormats.long,
availableFormats: defCa.dateTimeFormats.availableFormats,
dateFormats: basicDateFormats,
timeFormats: basicTimeFormats,
timeFormats: basicTimeFormats
};
});

Expand Down
28 changes: 14 additions & 14 deletions src/11.numberformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
// ======================================

import {
IsWellFormedCurrencyCode,
IsWellFormedCurrencyCode
} from "./6.locales-currencies-tz.js";

import {
Intl,
Intl
} from "./8.intl.js";

import {
CanonicalizeLocaleList,
SupportedLocales,
ResolveLocale,
GetNumberOption,
GetOption,
GetOption
} from "./9.negotiation.js";

import {
Expand All @@ -33,14 +33,14 @@ import {
getInternalProperties,
createRegExpRestore,
secret,
objCreate,
objCreate
} from "./util.js";

// Currency minor units output from get-4217 grunt task, formatted
const currencyMinorUnits = {
BHD: 3, BYR: 0, XOF: 0, BIF: 0, XAF: 0, CLF: 4, CLP: 0, KMF: 0, DJF: 0,
XPF: 0, GNF: 0, ISK: 0, IQD: 3, JPY: 0, JOD: 3, KRW: 0, KWD: 3, LYD: 3,
OMR: 3, PYG: 0, RWF: 0, TND: 3, UGX: 0, UYI: 0, VUV: 0, VND: 0,
OMR: 3, PYG: 0, RWF: 0, TND: 3, UGX: 0, UYI: 0, VUV: 0, VND: 0
};

// Define the NumberFormat constructor internally so it cannot be tainted
Expand All @@ -58,12 +58,12 @@ export function NumberFormatConstructor () {
defineProperty(Intl, 'NumberFormat', {
configurable: true,
writable: true,
value: NumberFormatConstructor,
value: NumberFormatConstructor
});

// Must explicitly set prototypes as unwritable
defineProperty(Intl.NumberFormat, 'prototype', {
writable: false,
writable: false
});

/**
Expand All @@ -89,7 +89,7 @@ export function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, opti
// NOTE: Non-standard, for internal use only
if (arguments[0] === secret)
return internal;
},
}
});

// 2. Set the [[initializedIntlObject]] internal property of numberFormat to true.
Expand Down Expand Up @@ -321,7 +321,7 @@ function CurrencyDigits(currency) {
/* 11.2.3 */internals.NumberFormat = {
'[[availableLocales]]': [],
'[[relevantExtensionKeys]]': ['nu'],
'[[localeData]]': {},
'[[localeData]]': {}
};

/**
Expand Down Expand Up @@ -361,7 +361,7 @@ defineProperty(Intl.NumberFormat, 'supportedLocalesOf', {
// (defined in 9.2.8) with arguments availableLocales, requestedLocales,
// and options.
return SupportedLocales(availableLocales, requestedLocales, options);
}, internals.NumberFormat),
}, internals.NumberFormat)
});

/**
Expand All @@ -371,7 +371,7 @@ defineProperty(Intl.NumberFormat, 'supportedLocalesOf', {
*/
/* 11.3.2 */defineProperty(Intl.NumberFormat.prototype, 'format', {
configurable: true,
get: GetFormatNumber,
get: GetFormatNumber
});

function GetFormatNumber() {
Expand Down Expand Up @@ -891,7 +891,7 @@ let numSys = {
tamldec: ['\u0BE6', '\u0BE7', '\u0BE8', '\u0BE9', '\u0BEA', '\u0BEB', '\u0BEC', '\u0BED', '\u0BEE', '\u0BEF'],
telu: ['\u0C66', '\u0C67', '\u0C68', '\u0C69', '\u0C6A', '\u0C6B', '\u0C6C', '\u0C6D', '\u0C6E', '\u0C6F'],
thai: ['\u0E50', '\u0E51', '\u0E52', '\u0E53', '\u0E54', '\u0E55', '\u0E56', '\u0E57', '\u0E58', '\u0E59'],
tibt: ['\u0F20', '\u0F21', '\u0F22', '\u0F23', '\u0F24', '\u0F25', '\u0F26', '\u0F27', '\u0F28', '\u0F29'],
tibt: ['\u0F20', '\u0F21', '\u0F22', '\u0F23', '\u0F24', '\u0F25', '\u0F26', '\u0F27', '\u0F28', '\u0F29']
};

/**
Expand All @@ -916,7 +916,7 @@ let numSys = {
props = [
'locale', 'numberingSystem', 'style', 'currency', 'currencyDisplay',
'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits',
'minimumSignificantDigits', 'maximumSignificantDigits', 'useGrouping',
'minimumSignificantDigits', 'maximumSignificantDigits', 'useGrouping'
],
internal = this !== null && typeof this === 'object' && getInternalProperties(this);

Expand All @@ -930,5 +930,5 @@ let numSys = {
}

return objCreate({}, descs);
},
}
});
Loading

0 comments on commit 39180f1

Please sign in to comment.