Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-plaintime.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.plaintime.from
7 description: A PlainTime object is copied, not returned directly
8 includes: [temporalHelpers.js]
9 features: [Temporal]
10 ---*/
11
12 const orig = new Temporal.PlainTime(11, 42, 0, 0, 0, 0);
13 const result = Temporal.PlainTime.from(orig);
14
15 TemporalHelpers.assertPlainTime(
16 result,
17 11, 42, 0, 0, 0, 0,
18 "PlainTime is copied"
19 );
20
21 assert.notSameValue(
22 result,
23 orig,
24 "When a PlainTime is given, the returned value is not the original PlainTime"
25 );
26
27 reportCompare(0, 0);