Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/fromEpochMilliseconds/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.fromepochmilliseconds
7 description: Basic tests for Instant.fromEpochMilliseconds().
8 features: [BigInt, Temporal]
9 ---*/
10
11 const afterEpoch = Temporal.Instant.fromEpochMilliseconds(217175010_123);
12 assert.sameValue(afterEpoch.epochNanoseconds, 217175010_123_000_000n, "fromEpochMilliseconds post epoch");
13
14 const beforeEpoch = Temporal.Instant.fromEpochMilliseconds(-217175010_876);
15 assert.sameValue(beforeEpoch.epochNanoseconds, -217175010_876_000_000n, "fromEpochMilliseconds pre epoch");
16
17 reportCompare(0, 0);