tor-browser

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

argument-invalid.js (723B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2024 André Bargull. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-temporal.plainmonthday
      7 description: PlainMonthDay constructor with invalid iso dates
      8 features: [Temporal]
      9 ---*/
     10 
     11 const tests = [
     12  [2020, 0, 24],
     13  [2020, 13, 24],
     14  [2020, -3, 24],
     15  [2020, 12, 32],
     16  [2020, 2, 30],
     17  [2019, 2, 29],
     18  [2019, 2, 0],
     19  [2019, 2, -20],
     20 ];
     21 
     22 for (const [year, month, day] of tests) {
     23  assert.throws(RangeError, () => new Temporal.PlainMonthDay(month, day, undefined, year),
     24    `year=${year}, month=${month}, day=${day}`);
     25 }
     26 
     27 reportCompare(0, 0);