tor-browser

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

argument-string-with-offset-not-valid-epoch-nanoseconds.js (659B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2022 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.instant.compare
      7 description: >
      8  Throws when argument at maximum representable date/time value with a negative offset.
      9 features: [Temporal]
     10 ---*/
     11 
     12 // Not a valid epoch nanoseconds value due to the offset.
     13 var one = "+275760-09-13T00:00:00.000-12";
     14 
     15 var two = {
     16  toString() {
     17    throw new Test262Error();
     18  }
     19 };
     20 
     21 assert.throws(RangeError, () => Temporal.Instant.compare(one, two));
     22 
     23 reportCompare(0, 0);