tor-browser

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

leap-year-hebrew.js (1044B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2025 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.from
      7 description: Basic functionality of resolving fields in hebrew calendar leap year
      8 features: [Temporal, Intl.Era-monthcode]
      9 includes: [temporalHelpers.js]
     10 ---*/
     11 
     12 const calendar = "hebrew";
     13 const options = { overflow: "reject" };
     14 
     15 const leapYear = 5784;
     16 const monthCodes5784 = [
     17  undefined,
     18  "M01",
     19  "M02",
     20  "M03",
     21  "M04",
     22  "M05",
     23  "M05L",
     24  "M06",
     25  "M07",
     26  "M08",
     27  "M09",
     28  "M10",
     29  "M11",
     30  "M12"
     31 ];
     32 
     33 for (let month = 1; month < 14; month++) {
     34  const monthCode = monthCodes5784[month];
     35 
     36  const instance = Temporal.PlainYearMonth.from({ year: leapYear, month, calendar }, options);
     37  TemporalHelpers.assertPlainYearMonth(
     38    instance,
     39    leapYear, month, monthCode,
     40    `month ${monthCode} in leap year`,
     41    "am", leapYear, null
     42  );
     43 }
     44 
     45 
     46 reportCompare(0, 0);