mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 13:04:39 +02:00
Update:RangeError when useGrouping is string 'undefined'
This commit is contained in:
parent
e17d44db65
commit
1714f231c7
@ -35,6 +35,5 @@ assert.sameValue(render({notation: 'compact', useGrouping: false}), false, 'comp
|
|||||||
assert.sameValue(render({notation: 'compact', useGrouping: null}), false, 'compact, null');
|
assert.sameValue(render({notation: 'compact', useGrouping: null}), false, 'compact, null');
|
||||||
assert.sameValue(render({notation: 'compact', useGrouping: 'min2'}), 'min2', 'compact, "min2"');
|
assert.sameValue(render({notation: 'compact', useGrouping: 'min2'}), 'min2', 'compact, "min2"');
|
||||||
|
|
||||||
assert.sameValue(render({useGrouping: 'undefined'}), 'auto', 'use fallback value');
|
|
||||||
assert.sameValue(render({useGrouping: 'false'}), 'auto', 'use fallback value');
|
assert.sameValue(render({useGrouping: 'false'}), 'auto', 'use fallback value');
|
||||||
assert.sameValue(render({useGrouping: 'true'}), 'auto', 'use fallback value');
|
assert.sameValue(render({useGrouping: 'true'}), 'auto', 'use fallback value');
|
||||||
|
@ -31,7 +31,7 @@ for (let falsy of [0, null, ""]) {
|
|||||||
assert.sameValue(resolveUseGrouping(falsy), false);
|
assert.sameValue(resolveUseGrouping(falsy), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let invalidOptions of [42, "MIN2", {} , "True", "TRUE" , "FALSE" , "False"]) {
|
for (let invalidOptions of [42, "MIN2", {} , "True", "TRUE" , "FALSE" , "False" , "Undefined" , "undefined"]) {
|
||||||
assert.throws(RangeError, function () {
|
assert.throws(RangeError, function () {
|
||||||
return new Intl.NumberFormat(undefined, { useGrouping: invalidOptions });
|
return new Intl.NumberFormat(undefined, { useGrouping: invalidOptions });
|
||||||
}, "Throws RangeError when useGrouping value is not supported");
|
}, "Throws RangeError when useGrouping value is not supported");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user