mirror of https://github.com/tc39/test262.git
limit the range to 1 to 3 only
This commit is contained in:
parent
19653bdfc8
commit
e620226cd7
|
@ -31,8 +31,23 @@ function assertParts(parts, minute, second, fractionalSecond, message) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let dtf = new Intl.DateTimeFormat(
|
assert.throws(RangeError, () => {
|
||||||
|
new Intl.DateTimeFormat(
|
||||||
'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 0});
|
'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"});
|
||||||
|
assertParts(dtf.formatToParts(d1), "02", "03", null, "no fractionalSecondDigits round down");
|
||||||
|
assertParts(dtf.formatToParts(d2), "02", "03", null, "no fractionalSecondDigits round down");
|
||||||
|
|
||||||
|
dtf = new Intl.DateTimeFormat(
|
||||||
|
'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: undefined});
|
||||||
assertParts(dtf.formatToParts(d1), "02", "03", null, "no fractionalSecondDigits round down");
|
assertParts(dtf.formatToParts(d1), "02", "03", null, "no fractionalSecondDigits round down");
|
||||||
assertParts(dtf.formatToParts(d2), "02", "03", null, "no fractionalSecondDigits round down");
|
assertParts(dtf.formatToParts(d2), "02", "03", null, "no fractionalSecondDigits round down");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue