1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-temporal.zoneddatetime.prototype.equals
7 description: An iterable returned from timeZone.getPossibleInstantsFor is consumed after each call
9 sec-temporal.zoneddatetime.prototype.equals step 3:
10 3. Set _other_ to ? ToTemporalZonedDateTime(_other_).
11 sec-temporal-totemporalzoneddatetime step 7:
12 7. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_result_.[[Year]], [...], _result_.[[Nanosecond]], _offsetNanoseconds_, _timeZone_, _disambiguation_, _offset_).
13 sec-temporal-interpretisodatetimeoffset step 7:
14 7. Let _possibleInstants_ be ? GetPossibleInstantsFor(_timeZone_, _dateTime_).
15 sec-temporal-getpossibleinstantsfor step 2:
16 2. Let _list_ be ? IterableToList(_possibleInstants_).
17 includes: [temporalHelpers.js]
21 // Not called on the instance's time zone
25 TemporalHelpers.checkTimeZonePossibleInstantsIterable((timeZone) => {
26 const datetime = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone);
27 datetime.equals({ year: 2005, month: 6, day: 2, timeZone: "UTC" });
30 // Called on the argument's time zone
33 "2005-06-02T00:00:00",
36 TemporalHelpers.checkTimeZonePossibleInstantsIterable((timeZone) => {
37 const datetime = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC");
38 datetime.equals({ year: 2005, month: 6, day: 2, timeZone });