Temporal: Don't observably iterate array in built-in calendar's fields()

Note the monkeypatch of getPossibleInstantsFor in test/built-ins/Temporal/
TimeZone/prototype/getInstantFor/argument-builtin-calendar-no-array-
iteration.js.

Other than that, all the tests are basically identical.
This commit is contained in:
Philip Chimento 2023-08-18 09:29:25 -07:00 committed by Ms2ger
parent fdd44e2ea5
commit a74fbada42
67 changed files with 1406 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.dateAdd(arg, new Temporal.Duration());
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.calendar.prototype.dateuntil
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.dateUntil(arg, new Temporal.PlainDate(1977, 11, 19));
instance.dateUntil(new Temporal.PlainDate(1977, 11, 19), arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.day(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.dayOfWeek(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.dayOfYear(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.daysInMonth(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.daysInWeek(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.daysInYear(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.inLeapYear(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.month(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.monthCode(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.monthsInYear(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.weekOfYear(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.year(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.calendar.prototype.yearofweek
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.yearOfWeek(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,23 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.duration.compare
description: >
Calling the method with a relativeTo property bag with a builtin calendar
causes no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const relativeTo = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
const duration1 = new Temporal.Duration(0, 0, 1);
const duration2 = new Temporal.Duration(0, 0, 0, 7);
Temporal.Duration.compare(duration1, duration2, { relativeTo });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.duration.prototype.add
description: >
Calling the method with a relativeTo property bag with a builtin calendar
causes no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.Duration(1, 0, 0, 1);
const relativeTo = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 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: >
Calling the method with a relativeTo property bag with a builtin calendar
causes no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.Duration(1, 0, 0, 0, 24);
const relativeTo = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.round({ largestUnit: "years", relativeTo });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.duration.prototype.subtract
description: >
Calling the method with a relativeTo property bag with a builtin calendar
causes no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.Duration(1, 0, 0, 1);
const relativeTo = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.duration.prototype.total
description: >
Calling the method with a relativeTo property bag with a builtin calendar
causes no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.Duration(1, 0, 0, 0, 24);
const relativeTo = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.total({ unit: "days", relativeTo });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.compare
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
Temporal.PlainDate.compare(arg, new Temporal.PlainDate(1976, 11, 18));
Temporal.PlainDate.compare(new Temporal.PlainDate(1976, 11, 18), arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.from
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
Temporal.PlainDate.from(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDate(2000, 5, 2);
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.equals(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDate(2000, 5, 2);
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.since(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.prototype.toplainmonthday
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDate(2023, 5, 2, "iso8601");
instance.toPlainMonthDay();
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.prototype.toplainyearmonth
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDate(2023, 5, 2, "iso8601");
instance.toPlainYearMonth();
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDate(2000, 5, 2);
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.until(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.prototype.with
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDate(2023, 5, 2, "iso8601");
instance.with({ day: 5 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.compare
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
Temporal.PlainDateTime.compare(arg, new Temporal.PlainDateTime(1976, 11, 18));
Temporal.PlainDateTime.compare(new Temporal.PlainDateTime(1976, 11, 18), arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.from
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
Temporal.PlainDateTime.from(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.equals
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
instance.equals(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.since
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
instance.since(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.toplainmonthday
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2023, 5, 2, 12, 34, 56, 987, 654, 321, "iso8601");
instance.toPlainMonthDay();
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.toplainyearmonth
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2023, 5, 2, 12, 34, 56, 987, 654, 321, "iso8601");
instance.toPlainYearMonth();
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.until
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
instance.until(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.with
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2023, 5, 2, 12, 34, 56, 987, 654, 321, "iso8601");
instance.with({ day: 5 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.withPlainDate(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainmonthday.from
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { monthCode: "M11", day: 23, calendar: "iso8601" };
Temporal.PlainMonthDay.from(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainmonthday.prototype.equals
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainMonthDay(5, 2);
const arg = { monthCode: "M11", day: 23, calendar: "iso8601" };
instance.equals(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainmonthday.prototype.toplaindate
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainMonthDay(5, 1, "iso8601");
instance.toPlainDate({ year: 2005 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainmonthday.prototype.with
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainMonthDay(5, 1, "iso8601");
instance.with({ monthCode: "M04" });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.toPlainDateTime(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.compare
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { year: 2000, month: 5, calendar: "iso8601" };
Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6));
Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.from
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const arg = { year: 2000, month: 5, calendar: "iso8601" };
Temporal.PlainYearMonth.from(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.add
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2023, 5, "iso8601");
instance.add({ years: 5, months: 2 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.equals
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2000, 5);
const arg = { year: 2000, month: 5, calendar: "iso8601" };
instance.equals(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.since
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2000, 5);
const arg = { year: 2000, month: 5, calendar: "iso8601" };
instance.since(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.since
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2023, 5, "iso8601");
instance.since({ year: 2005, month: 3 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.subtract
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2023, 5, "iso8601");
instance.subtract({ years: 5, months: 2 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.toplaindate
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2023, 5, "iso8601");
instance.toPlainDate({ day: 5 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.until
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2000, 5);
const arg = { year: 2000, month: 5, calendar: "iso8601" };
instance.until(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.until
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2023, 5, "iso8601");
instance.until({ year: 2070, month: 7 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainyearmonth.prototype.with
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.PlainYearMonth(2023, 5, "iso8601");
instance.with({ month: 4 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,29 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.timezone.prototype.getinstantfor
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.TimeZone("UTC");
// Patch getPossibleInstantsFor to allow the spec-mandated observable array
// iteration in the GetPossibleInstantsFor AO.
instance.getPossibleInstantsFor = function (...args) {
const instants = Temporal.TimeZone.prototype.getPossibleInstantsFor.apply(this, args);
instants[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;
return instants;
}
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
instance.getInstantFor(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.timezone.prototype.getpossibleinstantsfor
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.TimeZone("UTC");
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, calendar: "iso8601" };
instance.getPossibleInstantsFor(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,23 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const datetime = new Temporal.ZonedDateTime(0n, timeZone);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
Temporal.ZonedDateTime.compare(arg, datetime);
Temporal.ZonedDateTime.compare(datetime, arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.from
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
Temporal.ZonedDateTime.from(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.equals
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.ZonedDateTime(0n, timeZone);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.equals(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.since
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.ZonedDateTime(0n, timeZone);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.since(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.toplainmonthday
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", "iso8601");
instance.toPlainMonthDay();
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.toplainyearmonth
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", "iso8601");
instance.toPlainYearMonth();
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,22 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.until
description: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const timeZone = "UTC";
const instance = new Temporal.ZonedDateTime(0n, timeZone);
const arg = { year: 2000, month: 5, day: 2, hour: 21, minute: 43, second: 5, timeZone, calendar: "iso8601" };
instance.until(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.with
description: >
Calling the method on an instance constructed with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", "iso8601");
instance.with({ day: 5 });
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.withPlainDate(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.era(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2023 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: >
Calling the method with a property bag argument with a builtin calendar causes
no observable array iteration when getting the calendar fields.
features: [Temporal]
---*/
const arrayPrototypeSymbolIteratorOriginal = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function arrayIterator() {
throw new Test262Error("Array should not be iterated");
}
const instance = new Temporal.Calendar("iso8601");
const arg = { year: 2000, month: 5, day: 2, calendar: "iso8601" };
instance.eraYear(arg);
Array.prototype[Symbol.iterator] = arrayPrototypeSymbolIteratorOriginal;