mirror of https://github.com/tc39/test262.git
Simplify default value check of NumberFormat.format
This commit is contained in:
parent
cbfa2c5f00
commit
a6412918d2
|
@ -12,32 +12,6 @@ info: |
|
||||||
3. If value is not provided, let value be undefined.
|
3. If value is not provided, let value be undefined.
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const localesList = [
|
const nf = new Intl.NumberFormat();
|
||||||
undefined,
|
assert.sameValue(nf.format(), NaN);
|
||||||
['de'],
|
assert.sameValue(nf.format(undefined), NaN);
|
||||||
['th-u-nu-thai'],
|
|
||||||
['en'],
|
|
||||||
['ja-u-nu-jpanfin'],
|
|
||||||
['ar-u-nu-arab']
|
|
||||||
];
|
|
||||||
const optionsList = [
|
|
||||||
undefined,
|
|
||||||
{ style: 'percent' },
|
|
||||||
{ style: 'currency', currency: 'EUR', currencyDisplay: 'symbol' },
|
|
||||||
{ style: 'currency', currency: 'IQD', currencyDisplay: 'symbol' },
|
|
||||||
{ style: 'currency', currency: 'KMF', currencyDisplay: 'symbol' },
|
|
||||||
{ style: 'currency', currency: 'CLF', currencyDisplay: 'symbol' },
|
|
||||||
{
|
|
||||||
useGrouping: false,
|
|
||||||
minimumIntegerDigits: 3,
|
|
||||||
minimumFractionDigits: 1,
|
|
||||||
maximumFractionDigits: 3
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
localesList.forEach(locales => {
|
|
||||||
optionsList.forEach(options => {
|
|
||||||
const nf = Intl.NumberFormat(locales, options);
|
|
||||||
assert.sameValue(nf.format(), nf.format(undefined));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
Loading…
Reference in New Issue