mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
In many cases we created a TimeZone or Calendar instance from a built-in time zone or calendar. These tests can be trivially adapted to just use the string ID.
16 lines
789 B
JavaScript
16 lines
789 B
JavaScript
// 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.compare
|
|
description: Property bag with offset property is rejected if offset does not agree with time zone
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const timeZone = "+01:00";
|
|
const datetime = new Temporal.ZonedDateTime(0n, timeZone);
|
|
|
|
const properties = { year: 2021, month: 10, day: 28, offset: "-07:00", timeZone };
|
|
assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(properties, datetime), "offset property not matching time zone is rejected (first argument)");
|
|
assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(datetime, properties), "offset property not matching time zone is rejected (second argument)");
|