Update:RangeError when useGrouping is string 'undefined'

This commit is contained in:
Romulo Cintra 2022-09-13 10:45:41 +02:00 committed by Philip Chimento
parent e17d44db65
commit 1714f231c7
2 changed files with 1 additions and 2 deletions

View File

@ -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: '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: 'true'}), 'auto', 'use fallback value');

View File

@ -31,7 +31,7 @@ for (let falsy of [0, null, ""]) {
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 () {
return new Intl.NumberFormat(undefined, { useGrouping: invalidOptions });
}, "Throws RangeError when useGrouping value is not supported");