mirror of https://github.com/tc39/test262.git
Update tests which used negative day lengths
Negative day lengths are no longer valid after <https://github.com/tc39/proposal-temporal/pull/2261>.
This commit is contained in:
parent
e623dd7a11
commit
bea421c1dc
|
@ -9,7 +9,8 @@ info: |
|
|||
Temporal.ZonedDateTime.prototype.round ( roundTo )
|
||||
...
|
||||
18. Let dayLengthNs be ℝ(endNs - startNs).
|
||||
...
|
||||
19. If dayLengthNs ≤ 0, then
|
||||
a. Throw a RangeError exception.
|
||||
20. Let roundResult be ! RoundISODateTime(temporalDateTime.[[ISOYear]],
|
||||
temporalDateTime.[[ISOMonth]], temporalDateTime.[[ISODay]], temporalDateTime.[[ISOHour]],
|
||||
temporalDateTime.[[ISOMinute]], temporalDateTime.[[ISOSecond]],
|
||||
|
@ -74,12 +75,10 @@ const oneDay = 24n * 60n * 60n * 1000n * 1000n * 1000n
|
|||
{
|
||||
let tz = new TimeZone(minInstant);
|
||||
let zoned = new Temporal.ZonedDateTime(0n, tz);
|
||||
let result = zoned.round({ smallestUnit: "days" });
|
||||
assert(zoned.equals(result));
|
||||
assert.throws(RangeError, () => zoned.round({ smallestUnit: "days" }));
|
||||
}
|
||||
{
|
||||
let tz = new TimeZone(minInstant);
|
||||
let zoned = new Temporal.ZonedDateTime(maxInstant - oneDay, tz);
|
||||
let result = zoned.round({ smallestUnit: "days" });
|
||||
assert(zoned.equals(result));
|
||||
assert.throws(RangeError, () => zoned.round({ smallestUnit: "days" }));
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ info: |
|
|||
Temporal.ZonedDateTime.prototype.round ( roundTo )
|
||||
...
|
||||
18. Let dayLengthNs be ℝ(endNs - startNs).
|
||||
19. If dayLengthNs is 0, then
|
||||
19. If dayLengthNs ≤ 0, then
|
||||
a. Throw a RangeError exception.
|
||||
20. Let roundResult be ! RoundISODateTime(temporalDateTime.[[ISOYear]],
|
||||
temporalDateTime.[[ISOMonth]], temporalDateTime.[[ISODay]], temporalDateTime.[[ISOHour]],
|
||||
|
@ -62,6 +62,5 @@ class TimeZone extends Temporal.TimeZone {
|
|||
{
|
||||
let tz = new TimeZone(-1n);
|
||||
let zoned = new Temporal.ZonedDateTime(0n, tz);
|
||||
let result = zoned.round({ smallestUnit: "days" });
|
||||
assert(zoned.equals(result));
|
||||
assert.throws(RangeError, () => zoned.round({ smallestUnit: "days" }));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue