Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/fromEpochNanoseconds/basic.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) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.instant.fromepochnanoseconds
7 description: Basic tests for Instant.fromEpochNanoseconds().
8 features: [BigInt, Temporal]
9 ---*/
10
11 const afterEpoch = Temporal.Instant.fromEpochNanoseconds(217175010_123_456_789n);
12 assert.sameValue(afterEpoch.epochNanoseconds, 217175010_123_456_789n, "fromEpochNanoseconds post epoch");
13
14 const beforeEpoch = Temporal.Instant.fromEpochNanoseconds(-217175010_876_543_211n);
15 assert.sameValue(beforeEpoch.epochNanoseconds, -217175010_876_543_211n, "fromEpochNanoseconds pre epoch");
16
17 reportCompare(0, 0);