Bug 1904139 - Don't re-initialize platform font list from GetDefaultFont. r=jfkthame
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / ZonedDateTime / prototype / equals / timezone-getpossibleinstantsfor-iterable.js
blob48f46ac772e04465033dd6da3ea904d8f6561fc5
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.
5 /*---
6 esid: sec-temporal.zoneddatetime.prototype.equals
7 description: An iterable returned from timeZone.getPossibleInstantsFor is consumed after each call
8 info: |
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]
18 features: [Temporal]
19 ---*/
21 // Not called on the instance's time zone
23 const expected1 = [];
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" });
28 }, expected1);
30 // Called on the argument's time zone
32 const expected2 = [
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 });
39 }, expected2);
41 reportCompare(0, 0);