tor-browser

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

calendar-invalid.js (909B)


      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 description: Temporal.PlainMonthDay throws a RangeError if the calendar argument is invalid
      7 esid: sec-temporal.plainmonthday
      8 includes: [compareArray.js, temporalHelpers.js]
      9 features: [Temporal]
     10 ---*/
     11 
     12 const expected = ["get month.valueOf", "call month.valueOf", "get day.valueOf", "call day.valueOf"];
     13 const actual = [];
     14 const args = [
     15  TemporalHelpers.toPrimitiveObserver(actual, 2, "month"),
     16  TemporalHelpers.toPrimitiveObserver(actual, 1, "day"),
     17  "local",
     18  TemporalHelpers.toPrimitiveObserver(actual, 1, "year")
     19 ];
     20 assert.throws(RangeError, () => new Temporal.PlainMonthDay(...args));
     21 assert.compareArray(actual, expected, "order of operations");
     22 
     23 reportCompare(0, 0);