summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/basic.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/basic.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/basic.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/basic.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/basic.js
new file mode 100644
index 0000000000..f0237adf44
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/basic.js
@@ -0,0 +1,19 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-get-temporal.zoneddatetime.prototype.epochnanoseconds
+description: Basic tests for epochNanoseconds.
+features: [BigInt, Temporal]
+---*/
+
+const afterEpoch = new Temporal.ZonedDateTime(217175010_123_456_789n, "UTC");
+assert.sameValue(afterEpoch.epochNanoseconds, 217175010_123_456_789n, "epochNanoseconds post epoch");
+assert.sameValue(typeof afterEpoch.epochNanoseconds, "bigint", "epochNanoseconds value is a bigint");
+
+const beforeEpoch = new Temporal.ZonedDateTime(-217175010_876_543_211n, "UTC");
+assert.sameValue(beforeEpoch.epochNanoseconds, -217175010_876_543_211n, "epochNanoseconds pre epoch");
+assert.sameValue(typeof beforeEpoch.epochNanoseconds, "bigint", "epochNanoseconds value is a bigint");
+
+reportCompare(0, 0);