tor-browser

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

argument-propertybag-calendar-year-zero.js (970B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2022 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: Negative zero, as an extended year, is rejected
      8 features: [Temporal, arrow-function]
      9 ---*/
     10 
     11 const invalidStrings = [
     12  "-000000-10-31",
     13  "-000000-10-31T17:45",
     14  "-000000-10-31T17:45Z",
     15  "-000000-10-31T17:45+01:00",
     16  "-000000-10-31T17:45+00:00[UTC]",
     17 ];
     18 
     19 invalidStrings.forEach((arg) => {
     20  assert.throws(
     21    RangeError,
     22    () => Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6)),
     23    "reject minus zero as extended year (first argument)"
     24  );
     25  assert.throws(
     26    RangeError,
     27    () => Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg),
     28    "reject minus zero as extended year (second argument)"
     29  );
     30 });
     31 
     32 reportCompare(0, 0);