Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainMonthDay / prototype / equals / calendar-temporal-object.js
blob49c57643d0831f6d56656e103074730254be614a
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-temporal.plainmonthday.prototype.equals
7 description: Fast path for converting other Temporal objects to Temporal.Calendar by reading internal slots
8 info: |
9     sec-temporal.plainmonthday.prototype.equals step 3:
10       3. Set _other_ to ? ToTemporalMonthDay(_other_).
11     sec-temporal-totemporalmonthday step 3.e:
12       e. Let _calendar_ be ? GetTemporalCalendarWithISODefault(_item_).
13     sec-temporal-gettemporalcalendarwithisodefault step 2:
14       2. Return ? ToTemporalCalendarWithISODefault(_calendar_).
15     sec-temporal-totemporalcalendarwithisodefault step 2:
16       3. Return ? ToTemporalCalendar(_temporalCalendarLike_).
17     sec-temporal-totemporalcalendar step 1.a:
18       a. If _temporalCalendarLike_ has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
19         i. Return _temporalCalendarLike_.[[Calendar]].
20 includes: [compareArray.js, temporalHelpers.js]
21 features: [Temporal]
22 ---*/
24 TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject) => {
25   const monthday = new Temporal.PlainMonthDay(5, 2, temporalObject);
26   monthday.equals({ monthCode: "M06", day: 2, calendar: temporalObject });
27 });
29 reportCompare(0, 0);