tor-browser

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

invalid-month-codes-hebrew.js (919B)


      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.plaindatetime.from
      7 description: Month codes that are invalid for Hebrew calendar
      8 features: [Temporal, Intl.Era-monthcode]
      9 ---*/
     10 
     11 const calendar = "hebrew";
     12 
     13 assert.throws(RangeError, () => {
     14  Temporal.PlainDateTime.from({ year: 5779, monthCode: "M13", day: 1, hour: 12, minute: 34, calendar });
     15 }, "M13 should not be a valid month code");
     16 
     17 // Invalid leap months: e.g. M02L
     18 for (var i = 1; i <= 12; i++) {
     19  if (i === 5)
     20    continue;
     21  const monthCode = `M${ i.toString().padStart(2, "0") }L`;
     22  assert.throws(RangeError, function () {
     23    Temporal.PlainDateTime.from({ year: 5779, monthCode, day: 1, hour: 12, minute: 34, calendar });
     24  });
     25 }
     26 
     27 reportCompare(0, 0);