mirror of https://github.com/tc39/test262.git
Temporal: Add tests for ZonedDateTime to PlainDate conversion.
Also rename leap second tests for consistency.
This commit is contained in:
parent
6f8e0f67ca
commit
494b678cc5
19
test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dateadd
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.dateAdd(arg, new Temporal.Duration()));
|
19
test/built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.day
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.day(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dayofweek
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.dayOfWeek(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dayofyear
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.dayOfYear(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.daysinmonth
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.daysInMonth(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.daysinweek
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.daysInWeek(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.daysinyear
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.daysInYear(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.inleapyear
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.inLeapYear(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/month/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/month/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.month
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.month(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/monthCode/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/monthCode/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.monthcode
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.monthCode(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.monthsinyear
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.monthsInYear(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.weekofyear
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.weekOfYear(arg));
|
19
test/built-ins/Temporal/Calendar/prototype/year/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Calendar/prototype/year/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.year
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.year(arg));
|
19
test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.duration.prototype.round
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Duration(0, 0, 0, 365);
|
||||
|
||||
assert.throws(Test262Error, () => instance.round({ relativeTo: arg, largestUnit: "years" }));
|
19
test/built-ins/Temporal/PlainDate/prototype/equals/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/PlainDate/prototype/equals/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.equals
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.PlainDate(1976, 11, 18);
|
||||
|
||||
assert.throws(Test262Error, () => instance.equals(arg));
|
19
test/built-ins/Temporal/PlainDate/prototype/since/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/PlainDate/prototype/since/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.since
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.PlainDate(1976, 11, 18);
|
||||
|
||||
assert.throws(Test262Error, () => instance.since(arg));
|
19
test/built-ins/Temporal/PlainDate/prototype/until/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/PlainDate/prototype/until/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.until
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.PlainDate(1976, 11, 18);
|
||||
|
||||
assert.throws(Test262Error, () => instance.until(arg));
|
19
test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.prototype.withplaindate
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
|
||||
|
||||
assert.throws(Test262Error, () => instance.withPlainDate(arg));
|
19
test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.toplaindatetime
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
assert.throws(Test262Error, () => instance.toPlainDateTime(arg));
|
19
test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.tozoneddatetime
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
assert.throws(Test262Error, () => instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }));
|
19
test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.prototype.withplaindate
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC");
|
||||
|
||||
assert.throws(Test262Error, () => instance.withPlainDate(arg));
|
19
test/intl402/Temporal/Calendar/prototype/era/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/intl402/Temporal/Calendar/prototype/era/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.era
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.era(arg));
|
19
test/intl402/Temporal/Calendar/prototype/eraYear/argument-zoneddatetime-convert.js
vendored
Normal file
19
test/intl402/Temporal/Calendar/prototype/eraYear/argument-zoneddatetime-convert.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.erayear
|
||||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
class TZ extends Temporal.TimeZone {
|
||||
constructor() { super("UTC") }
|
||||
getOffsetNanosecondsFor() { throw new Test262Error() }
|
||||
}
|
||||
|
||||
const tz = new TZ();
|
||||
const arg = new Temporal.ZonedDateTime(0n, tz);
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
assert.throws(Test262Error, () => instance.eraYear(arg));
|
Loading…
Reference in New Issue