tor-browser

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

non-integer.js (1288B)


      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.instant.fromepochmilliseconds
      7 description: >
      8  RangeError thrown if input doesn't convert.
      9 info: |
     10  Temporal.Instant.fromEpochMilliseconds ( epochMilliseconds )
     11 
     12  ...
     13  2. Set epochMilliseconds to ? NumberToBigInt(epochMilliseconds).
     14  ...
     15 
     16  NumberToBigInt ( number )
     17 
     18  1. If number is not an integral Number, throw a RangeError exception.
     19  ...
     20 features: [Temporal]
     21 ---*/
     22 
     23 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(), "undefined");
     24 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(undefined), "undefined");
     25 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(Infinity), "Infinity");
     26 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(-Infinity), "-Infinity");
     27 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(NaN), "NaN");
     28 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(1.3), "1.3");
     29 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(-0.5), "-0.5");
     30 
     31 reportCompare(0, 0);