tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

calendar-temporal-object.js (1560B)


      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.
      4 
      5 /*---
      6 esid: sec-temporal.plainyearmonth.compare
      7 description: Fast path for converting other Temporal objects to Temporal.Calendar by reading internal slots
      8 info: |
      9    sec-temporal.plainyearmonth.compare steps 1–2:
     10      1. Set _one_ to ? ToTemporalYearMonth(_one_).
     11      2. Set _two_ to ? ToTemporalYearMonth(_two_).
     12    sec-temporal-totemporaldate step 2.b:
     13      b. Let _calendar_ be ? GetTemporalCalendarWithISODefault(_item_).
     14    sec-temporal-gettemporalcalendarwithisodefault step 2:
     15      2. Return ? ToTemporalCalendarWithISODefault(_calendar_).
     16    sec-temporal-totemporalcalendarwithisodefault step 2:
     17      3. Return ? ToTemporalCalendar(_temporalCalendarLike_).
     18    sec-temporal-totemporalcalendar step 1.a:
     19      a. If _temporalCalendarLike_ has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
     20        i. Return _temporalCalendarLike_.[[Calendar]].
     21 includes: [compareArray.js, temporalHelpers.js]
     22 features: [Temporal]
     23 ---*/
     24 
     25 TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject) => {
     26  Temporal.PlainYearMonth.compare(
     27    { year: 2000, month: 5, calendar: temporalObject },
     28    { year: 2001, month: 6, calendar: temporalObject },
     29  );
     30 });
     31 
     32 reportCompare(0, 0);