1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2023 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-temporal.plainmonthday.prototype.equals
6 description: If a calendar's fields() method returns duplicate field names, PrepareTemporalFields should throw a RangeError.
7 includes: [temporalHelpers.js]
11 for (const extra_fields of [['foo', 'foo'], ['day'], ['month'], ['monthCode'], ['year']]) {
12 const calendar = TemporalHelpers.calendarWithExtraFields(extra_fields);
13 const arg = { year: 2023, month: 5, monthCode: 'M05', day: 1, calendar: calendar };
14 const instance = new Temporal.PlainMonthDay(5, 2, calendar);
16 assert.throws(RangeError, () => instance.equals(arg));