From 1c47728a20017ee67e23fdfacbc81d5f471a72ba Mon Sep 17 00:00:00 2001 From: Aditi Date: Fri, 10 Feb 2023 11:02:07 +0530 Subject: [PATCH] Remove failing tests for CalendarFields and CalendarMergeFields --- .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../day/argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ ...o-propertybag-calendar-fields-undefined.js | 27 ------------ ...o-propertybag-calendar-fields-undefined.js | 27 ------------ ...o-propertybag-calendar-fields-undefined.js | 27 ------------ ...o-propertybag-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../calendar-fields-undefined.js | 25 ----------- .../calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../with/calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../calendar-fields-undefined.js | 25 ----------- .../calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../with/calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../toPlainDate/calendar-fields-undefined.js | 25 ----------- .../with/calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 41 ------------------- .../argument-calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 25 ----------- .../add/calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 27 ------------ .../since/calendar-fields-undefined.js | 27 ------------ .../subtract/calendar-fields-undefined.js | 25 ----------- .../toPlainDate/calendar-fields-undefined.js | 25 ----------- .../until/calendar-fields-undefined.js | 27 ------------ .../with/calendar-fields-undefined.js | 25 ----------- .../argument-calendar-fields-undefined.js | 39 ------------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 39 ------------------ .../argument-calendar-fields-undefined.js | 39 ------------------ .../argument-calendar-fields-undefined.js | 41 ------------------- .../argument-calendar-fields-undefined.js | 41 ------------------- .../calendar-fields-undefined.js | 39 ------------------ .../calendar-fields-undefined.js | 39 ------------------ .../argument-calendar-fields-undefined.js | 41 ------------------- .../with/calendar-fields-undefined.js | 39 ------------------ .../argument-calendar-fields-undefined.js | 41 ------------------- .../era/argument-calendar-fields-undefined.js | 27 ------------ .../argument-calendar-fields-undefined.js | 27 ------------ .../old/trivial-protocol-implementation.js | 8 ++++ .../Temporal/ZonedDateTime/old/equals.js | 1 + .../ZonedDateTime/old/toPlainMonthDay.js | 1 + .../ZonedDateTime/old/toPlainYearMonth.js | 1 + 68 files changed, 11 insertions(+), 1832 deletions(-) delete mode 100644 test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/day/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/month/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/year/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/compare/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/from/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/equals/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/since/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/until/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/with/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/compare/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/from/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/since/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/until/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/with/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/from/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/with/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/compare/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/from/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/since/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/until/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/with/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/compare/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/from/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/with/calendar-fields-undefined.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js delete mode 100644 test/intl402/Temporal/Calendar/prototype/era/argument-calendar-fields-undefined.js delete mode 100644 test/intl402/Temporal/Calendar/prototype/eraYear/argument-calendar-fields-undefined.js diff --git a/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-calendar-fields-undefined.js deleted file mode 100644 index 069cbe1f47..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-calendar-fields-undefined.js deleted file mode 100644 index b073972a11..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/day/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/day/argument-calendar-fields-undefined.js deleted file mode 100644 index 1009f03c37..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/day/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-calendar-fields-undefined.js deleted file mode 100644 index 93809cb554..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-calendar-fields-undefined.js deleted file mode 100644 index 27b7bca6e2..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-calendar-fields-undefined.js deleted file mode 100644 index e8e70549ec..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-calendar-fields-undefined.js deleted file mode 100644 index 5fbff5902c..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-calendar-fields-undefined.js deleted file mode 100644 index 7ec3d90bd2..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-calendar-fields-undefined.js deleted file mode 100644 index c0595d5b32..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/month/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/month/argument-calendar-fields-undefined.js deleted file mode 100644 index a5a139061a..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/month/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-calendar-fields-undefined.js deleted file mode 100644 index 9103858bbf..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-calendar-fields-undefined.js deleted file mode 100644 index 4c59331766..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-calendar-fields-undefined.js deleted file mode 100644 index 9b7e75c9d1..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/year/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/year/argument-calendar-fields-undefined.js deleted file mode 100644 index 9cbcd95944..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/year/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-calendar-fields-undefined.js deleted file mode 100644 index a9c1c7be3a..0000000000 --- a/test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-fields-undefined.js b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-fields-undefined.js deleted file mode 100644 index 3b4860ef89..0000000000 --- a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-fields-undefined.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-fields-undefined.js deleted file mode 100644 index 5be5a897da..0000000000 --- a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-fields-undefined.js b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-fields-undefined.js deleted file mode 100644 index 38e03015a3..0000000000 --- a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-fields-undefined.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-fields-undefined.js deleted file mode 100644 index 9207964e4f..0000000000 --- a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/compare/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/compare/argument-calendar-fields-undefined.js deleted file mode 100644 index e961c88642..0000000000 --- a/test/built-ins/Temporal/PlainDate/compare/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/from/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/from/argument-calendar-fields-undefined.js deleted file mode 100644 index ac5af22395..0000000000 --- a/test/built-ins/Temporal/PlainDate/from/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/prototype/equals/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/equals/argument-calendar-fields-undefined.js deleted file mode 100644 index b06e491246..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/equals/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/since/argument-calendar-fields-undefined.js deleted file mode 100644 index 8ce3ee4b83..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/since/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/calendar-fields-undefined.js deleted file mode 100644 index 7d16c30ebe..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/calendar-fields-undefined.js deleted file mode 100644 index b64ea890ec..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/until/argument-calendar-fields-undefined.js deleted file mode 100644 index 719de0a3f2..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/until/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDate/prototype/with/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/with/calendar-fields-undefined.js deleted file mode 100644 index bcfe3a463b..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/with/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/compare/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/compare/argument-calendar-fields-undefined.js deleted file mode 100644 index 86cd7e5d84..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/compare/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/from/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/from/argument-calendar-fields-undefined.js deleted file mode 100644 index 871c37a4f0..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/from/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-calendar-fields-undefined.js deleted file mode 100644 index 99dd1589da..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-calendar-fields-undefined.js deleted file mode 100644 index bf05d69d10..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js deleted file mode 100644 index 47465b7ef0..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js deleted file mode 100644 index f8a295e723..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-calendar-fields-undefined.js deleted file mode 100644 index d336b3ff9d..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/with/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/with/calendar-fields-undefined.js deleted file mode 100644 index 231e6026fa..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/with/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js deleted file mode 100644 index 22210a44c2..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainMonthDay/from/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainMonthDay/from/argument-calendar-fields-undefined.js deleted file mode 100644 index 1ab8faca01..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/from/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-calendar-fields-undefined.js deleted file mode 100644 index ec3e602786..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fields-undefined.js deleted file mode 100644 index 38dc03ded0..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/with/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainMonthDay/prototype/with/calendar-fields-undefined.js deleted file mode 100644 index 228207d627..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/with/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-calendar-fields-undefined.js deleted file mode 100644 index e6e9f1efa7..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-calendar-fields-undefined.js deleted file mode 100644 index ac6a7f558a..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/compare/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/compare/argument-calendar-fields-undefined.js deleted file mode 100644 index fc63eb24a0..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/compare/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/from/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/from/argument-calendar-fields-undefined.js deleted file mode 100644 index 3b29344fb6..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/from/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-fields-undefined.js deleted file mode 100644 index 5526e07d15..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-calendar-fields-undefined.js deleted file mode 100644 index c65533a50f..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/calendar-fields-undefined.js deleted file mode 100644 index d775950d9e..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-fields-undefined.js deleted file mode 100644 index be3b2eca9c..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fields-undefined.js deleted file mode 100644 index c841e16bab..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/calendar-fields-undefined.js deleted file mode 100644 index 05d42fbdc5..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/with/calendar-fields-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/with/calendar-fields-undefined.js deleted file mode 100644 index 24328c335f..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/with/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-calendar-fields-undefined.js deleted file mode 100644 index ea27bcc2d3..0000000000 --- a/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-calendar-fields-undefined.js deleted file mode 100644 index 23d62c4595..0000000000 --- a/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-calendar-fields-undefined.js deleted file mode 100644 index 6521610739..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-calendar-fields-undefined.js deleted file mode 100644 index 1dce02a5bf..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-calendar-fields-undefined.js deleted file mode 100644 index 05d9055113..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-calendar-fields-undefined.js deleted file mode 100644 index de2a8a129d..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js deleted file mode 100644 index d9f6de1b59..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js deleted file mode 100644 index a6e64c5fa9..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-calendar-fields-undefined.js deleted file mode 100644 index d060a91ec5..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/calendar-fields-undefined.js deleted file mode 100644 index cadd41c7ba..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js deleted file mode 100644 index 0991840993..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/intl402/Temporal/Calendar/prototype/era/argument-calendar-fields-undefined.js b/test/intl402/Temporal/Calendar/prototype/era/argument-calendar-fields-undefined.js deleted file mode 100644 index cf4972c007..0000000000 --- a/test/intl402/Temporal/Calendar/prototype/era/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/intl402/Temporal/Calendar/prototype/eraYear/argument-calendar-fields-undefined.js b/test/intl402/Temporal/Calendar/prototype/eraYear/argument-calendar-fields-undefined.js deleted file mode 100644 index d30f69c541..0000000000 --- a/test/intl402/Temporal/Calendar/prototype/eraYear/argument-calendar-fields-undefined.js +++ /dev/null @@ -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; diff --git a/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js b/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js index 514d846acd..21a3d2ab43 100644 --- a/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js +++ b/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js @@ -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, diff --git a/test/staging/Temporal/ZonedDateTime/old/equals.js b/test/staging/Temporal/ZonedDateTime/old/equals.js index c54608ff91..f6e831afc8 100644 --- a/test/staging/Temporal/ZonedDateTime/old/equals.js +++ b/test/staging/Temporal/ZonedDateTime/old/equals.js @@ -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); diff --git a/test/staging/Temporal/ZonedDateTime/old/toPlainMonthDay.js b/test/staging/Temporal/ZonedDateTime/old/toPlainMonthDay.js index 34720cf70a..9ae4f4e2f0 100644 --- a/test/staging/Temporal/ZonedDateTime/old/toPlainMonthDay.js +++ b/test/staging/Temporal/ZonedDateTime/old/toPlainMonthDay.js @@ -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, diff --git a/test/staging/Temporal/ZonedDateTime/old/toPlainYearMonth.js b/test/staging/Temporal/ZonedDateTime/old/toPlainYearMonth.js index 1b848b4bfd..9985d0d09f 100644 --- a/test/staging/Temporal/ZonedDateTime/old/toPlainYearMonth.js +++ b/test/staging/Temporal/ZonedDateTime/old/toPlainYearMonth.js @@ -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,