Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/from/argument-instant.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) 2022 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.from
7 description: A Instant object is copied, not returned directly
8 features: [Temporal]
9 ---*/
10
11 const orig = new Temporal.Instant(217_175_010_123_456_789n);
12 const result = Temporal.Instant.from(orig);
13
14 assert.sameValue(result.epochNanoseconds, 217_175_010_123_456_789n, "Instant is copied");
15
16 assert.notSameValue(
17 result,
18 orig,
19 "When an Instant is given, the returned value is not the original Instant"
20 );
21
22 reportCompare(0, 0);