mirror of https://github.com/tc39/test262.git
restrict the range from 1 to 3
This commit is contained in:
parent
e620226cd7
commit
21824359d0
|
@ -27,8 +27,18 @@ const d1 = new Date(2019, 7, 10, 1, 2, 3, 234);
|
|||
const d2 = new Date(2019, 7, 10, 1, 2, 3, 567);
|
||||
const d3 = new Date(2019, 7, 10, 1, 2, 13, 987);
|
||||
|
||||
assert.throws(RangeError, () => {
|
||||
new Intl.DateTimeFormat(
|
||||
'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 0});
|
||||
}, "fractionalSecondDigits 0 should throw RangeError for out of range");
|
||||
|
||||
assert.throws(RangeError, () => {
|
||||
new Intl.DateTimeFormat(
|
||||
'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 4});
|
||||
}, "fractionalSecondDigits 4 should throw RangeError for out of range");
|
||||
|
||||
let dtf = new Intl.DateTimeFormat(
|
||||
'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 0});
|
||||
'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: undefined});
|
||||
|
||||
compare(dtf.formatRangeToParts(d1, d2), [
|
||||
{ type: "minute", value: "02", source: "shared" },
|
||||
|
|
Loading…
Reference in New Issue