Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/limits.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
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
7 description: Min/max range.
8 includes: [temporalHelpers.js]
9 features: [Temporal]
10 ---*/
11
12
13 // constructing from ns
14 var limit = 8640000000000000000000n;
15 assert.throws(RangeError, () => new Temporal.Instant(-limit - 1n));
16 assert.throws(RangeError, () => new Temporal.Instant(limit + 1n));
17 TemporalHelpers.assertInstantsEqual(new Temporal.Instant(-limit),
18 Temporal.Instant.from("-271821-04-20T00:00:00Z"));
19 TemporalHelpers.assertInstantsEqual(new Temporal.Instant(limit),
20 Temporal.Instant.from("+275760-09-13T00:00:00Z"));
21
22 reportCompare(0, 0);