limits.js (957B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2018 Bloomberg LP. 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: Min/max range. 8 includes: [temporalHelpers.js] 9 features: [Temporal] 10 ---*/ 11 12 13 // constructing from ms 14 var limit = 8640000000000000; 15 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(-limit - 1)); 16 assert.throws(RangeError, () => Temporal.Instant.fromEpochMilliseconds(limit + 1)); 17 TemporalHelpers.assertInstantsEqual(Temporal.Instant.fromEpochMilliseconds(-limit), 18 Temporal.Instant.from("-271821-04-20T00:00:00Z")); 19 TemporalHelpers.assertInstantsEqual(Temporal.Instant.fromEpochMilliseconds(limit), 20 Temporal.Instant.from("+275760-09-13T00:00:00Z")); 21 22 23 reportCompare(0, 0);