Remove failing tests for CalendarFields and CalendarMergeFields

This commit is contained in:
Aditi 2023-02-10 11:02:07 +05:30 committed by Philip Chimento
parent b17b9411e0
commit 1c47728a20
68 changed files with 11 additions and 1832 deletions

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, dateAdd() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.dateAdd(arg, new Temporal.Duration());
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.dateuntil
description: >
When calendar.fields is undefined, dateUntil() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.dateUntil(arg, arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, day() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.day(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, dayOfWeek() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.dayOfWeek(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, dayOfYear() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.dayOfYear(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, daysInMonth() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.daysInMonth(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, daysInWeek() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.daysInWeek(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, daysInYear() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.daysInYear(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, inLeapYear() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.inLeapYear(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, month() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.month(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, monthCode() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.monthCode(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, monthsInYear() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.monthsInYear(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, weekOfYear() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.weekOfYear(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, year() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.year(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.yearofweek
description: >
When calendar.fields is undefined, yearOfWeek() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.yearOfWeek(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.add
description: >
When calendar.fields is undefined, add() doesn't perform an
observable array iteration to convert the property bag to relativeTo
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Duration(1, 0, 0, 1);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const relativeTo = { year: 1981, month: 12, day: 15, calendar };
instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, round() doesn't perform an
observable array iteration to convert the property bag to relativeTo
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Duration(1, 0, 0, 0, 24);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const relativeTo = { year: 1981, month: 12, day: 15, calendar };
instance.round({ largestUnit: "years", relativeTo });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.subtract
description: >
When calendar.fields is undefined, subtract() doesn't perform an
observable array iteration to convert the property bag to relativeTo
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Duration(1, 0, 0, 1);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const relativeTo = { year: 1981, month: 12, day: 15, calendar };
instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.total
description: >
When calendar.fields is undefined, total() doesn't perform an
observable array iteration to convert the property bag to relativeTo
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Duration(1, 0, 0, 0, 24);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const relativeTo = { year: 1981, month: 12, day: 15, calendar };
instance.total({ unit: "days", relativeTo });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.compare
description: >
When calendar.fields is undefined, compare() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
Temporal.PlainDate.compare(arg, arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.from
description: >
When calendar.fields is undefined, from() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
Temporal.PlainDate.from(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, equals() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDate(2000, 5, 2);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.equals(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, since() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDate(2000, 5, 2);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.since(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.toplainmonthday
description: >
When calendar.fields is undefined, toPlainMonthDay() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDate(1981, 12, 15, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainMonthDay();
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.toplainyearmonth
description: >
When calendar.fields is undefined, toPlainYearMonth() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDate(1981, 12, 15, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainYearMonth();
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, until() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDate(2000, 5, 2);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.until(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.with
description: >
When calendar.fields is undefined, with() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDate(1981, 12, 15, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.with({ year: 2022 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.compare
description: >
When calendar.fields is undefined, compare() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
Temporal.PlainDateTime.compare(arg, arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.from
description: >
When calendar.fields is undefined, from() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
Temporal.PlainDateTime.from(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.equals
description: >
When calendar.fields is undefined, equals() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.equals(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.since
description: >
When calendar.fields is undefined, since() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.since(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.toplainmonthday
description: >
When calendar.fields is undefined, toPlainMonthDay() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(1981, 12, 15, 14, 15, 45, 987, 654, 321, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainMonthDay();
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.toplainyearmonth
description: >
When calendar.fields is undefined, toPlainYearMonth() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(1981, 12, 15, 14, 15, 45, 987, 654, 321, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainYearMonth();
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.until
description: >
When calendar.fields is undefined, until() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.until(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.with
description: >
When calendar.fields is undefined, with() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(1981, 12, 15, 14, 15, 45, 987, 654, 321, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.with({ year: 2022 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, withPlainDate() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.withPlainDate(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainmonthday.prototype.from
description: >
When calendar.fields is undefined, from() doesn't perform an
observable array iteration to convert the property bag to PlainMonthDay
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { monthCode: "M12", day: 15, calendar };
Temporal.PlainMonthDay.from(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.plainmonthday.prototype.equals
description: >
When calendar.fields is undefined, equals() doesn't perform an
observable array iteration to convert the property bag to PlainMonthDay
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainMonthDay(5, 2);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { monthCode: "M12", day: 15, calendar };
instance.equals(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainmonthday.prototype.toplaindate
description: >
When calendar.fields is undefined, toPlainDate() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainMonthDay(12, 15, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainDate({ year: 2022 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainmonthday.prototype.with
description: >
When calendar.fields is undefined, with() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainMonthDay(12, 15, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.with({ day: 1 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, toPlainDateTime() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.toPlainDateTime(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,41 +0,0 @@
// 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: >
When calendar.fields is undefined, toZonedDateTime() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.toZonedDateTime({ plainDate: arg, timeZone });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainyearmonth.prototype.compare
description: >
When calendar.fields is undefined, compare() doesn't perform an
observable array iteration to convert the property bag to PlainYearMonth
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, calendar };
Temporal.PlainYearMonth.compare(arg, arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainyearmonth.prototype.from
description: >
When calendar.fields is undefined, from() doesn't perform an
observable array iteration to convert the property bag to PlainYearMonth
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, calendar };
Temporal.PlainYearMonth.from(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainyearmonth.prototype.add
description: >
When calendar.fields is undefined, add() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(1981, 12, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.add({ years: 1 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.plainyearmonth.prototype.equals
description: >
When calendar.fields is undefined, equals() doesn't perform an
observable array iteration to convert the property bag to PlainYearMonth
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(2000, 5);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, calendar };
instance.equals(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.plainyearmonth.prototype.since
description: >
When calendar.fields is undefined, since() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(1981, 12, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.since(new Temporal.PlainYearMonth(1979, 4, calendar));
// Check that no iteration is performed when converting a property bag either
instance.since({ year: 1979, month: 4, calendar });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainyearmonth.prototype.subtract
description: >
When calendar.fields is undefined, subtract() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(1981, 12, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.subtract({ years: 1 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainyearmonth.prototype.toplaindate
description: >
When calendar.fields is undefined, toPlainDate() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(1981, 12, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainDate({ day: 1 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.plainyearmonth.prototype.until
description: >
When calendar.fields is undefined, until() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(1981, 12, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.until(new Temporal.PlainYearMonth(2022, 10, calendar));
// Check that no iteration is performed when converting a property bag either
instance.since({ year: 2022, month: 10, calendar });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,25 +0,0 @@
// 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.plainyearmonth.prototype.with
description: >
When calendar.fields is undefined, with() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.PlainYearMonth(1981, 12, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.with({ year: 2022 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,39 +0,0 @@
// 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.timezone.prototype.getinstantfor
description: >
When calendar.fields is undefined, getInstantFor() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.getInstantFor(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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.timezone.prototype.getpossibleinstantsfor
description: >
When calendar.fields is undefined, getPossibleInstantsFor() doesn't perform an
observable array iteration to convert the property bag to PlainDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.TimeZone("UTC");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.getPossibleInstantsFor(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,39 +0,0 @@
// 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.compare
description: >
When calendar.fields is undefined, compare() doesn't perform an
observable array iteration to convert the property bag to ZonedDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, timeZone, calendar };
Temporal.ZonedDateTime.compare(arg, arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,39 +0,0 @@
// 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.from
description: >
When calendar.fields is undefined, from() doesn't perform an
observable array iteration to convert the property bag to ZonedDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, timeZone, calendar };
Temporal.ZonedDateTime.from(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,41 +0,0 @@
// 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.equals
description: >
When calendar.fields is undefined, equals() doesn't perform an
observable array iteration to convert the property bag to ZonedDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(0n, timeZone);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, timeZone, calendar };
instance.equals(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,41 +0,0 @@
// 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.since
description: >
When calendar.fields is undefined, since() doesn't perform an
observable array iteration to convert the property bag to ZonedDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(0n, timeZone);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, timeZone, calendar };
instance.since(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,39 +0,0 @@
// 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.toplainmonthday
description: >
When calendar.fields is undefined, toPlainMonthDay() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainMonthDay();
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,39 +0,0 @@
// 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.toplainyearmonth
description: >
When calendar.fields is undefined, toPlainYearMonth() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.toPlainYearMonth();
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,41 +0,0 @@
// 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.until
description: >
When calendar.fields is undefined, until() doesn't perform an
observable array iteration to convert the property bag to ZonedDateTime
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(0n, timeZone);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, timeZone, calendar };
instance.until(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,39 +0,0 @@
// 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.with
description: >
When calendar.fields is undefined, with() doesn't perform an
observable array iteration
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone, calendar);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
instance.with({ year: 2022 });
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,41 +0,0 @@
// 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: >
When calendar.fields is undefined, withPlainDate() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const timeZone = new class extends Temporal.TimeZone {
getPossibleInstantsFor(dt) {
const instants = super.getPossibleInstantsFor.call(this, dt);
// Return an iterable object that doesn't call Array iterator
return {
*[Symbol.iterator]() {
for (let index = 0; index < instants.length; index++) {
yield instants[index];
}
}
}
}
}("UTC");
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone);
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.withPlainDate(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, era() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.era(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -1,27 +0,0 @@
// 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: >
When calendar.fields is undefined, eraYear() doesn't perform an
observable array iteration to convert the property bag to PlainDate
features: [Temporal]
---*/
const calendar = new Temporal.Calendar("iso8601");
calendar.fields = undefined;
const instance = new Temporal.Calendar("iso8601");
// Detect observable array iteration:
const oldIterator = Array.prototype[Symbol.iterator];
Array.prototype[Symbol.iterator] = function () {
throw new Test262Error(`array shouldn't be iterated: ${new Error().stack}`);
};
const arg = { year: 1981, month: 12, day: 15, calendar };
instance.eraYear(arg);
Array.prototype[Symbol.iterator] = oldIterator;

View File

@ -40,6 +40,7 @@ var obj = {
toString() {
return "decimal";
},
fields(fieldNames) { return fieldNames; },
dateFromFields(fields, options) {
var {
overflow = "constrain"
@ -83,7 +84,14 @@ var obj = {
day(date) {
var {days} = isoToDecimal(date);
return days % 10 + 1;
},
mergeFields(fields, additionalFields) {
if ("month" in additionalFields || "monthCode" in additionalFields) {
let {month, monthCode, ...rest} = fields;
return {...rest, ...additionalFields};
}
return {...fields, ...additionalFields};
}
};
var date = Temporal.PlainDate.from({
year: 184,

View File

@ -14,6 +14,7 @@ var tz = {
var cal = {
dateFromFields(...args) { return Temporal.Calendar.from("iso8601").dateFromFields(...args); },
toString() { return "gregory"; },
fields(fieldNames) { return fieldNames; },
};
var zdt = new Temporal.ZonedDateTime(0n, tz, cal);

View File

@ -23,6 +23,7 @@ var fakeGregorian = {
monthCode(date) { return date.withCalendar("iso8601").monthCode; },
day(date) { return date.withCalendar("iso8601").day; },
toString() { return "gregory"; },
fields(fieldNames) { return fieldNames; },
};
var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTime({
timeZone: tz,

View File

@ -23,6 +23,7 @@ var fakeGregorian = {
year(date) { return date.withCalendar("iso8601").year; },
monthCode(date) { return date.withCalendar("iso8601").monthCode; },
toString() { return "gregory"; },
fields(fieldNames) { return fieldNames; },
};
var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTime({
timeZone: tz,