Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Duration/from/argument-existing-object.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) 2020 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.duration.from
7 description: Property bag is converted to Duration; Duration is copied
8 includes: [temporalHelpers.js]
9 features: [Temporal]
10 ---*/
11
12 const d1 = Temporal.Duration.from({ milliseconds: 1000, month: 1 });
13 TemporalHelpers.assertDuration(d1, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0);
14
15 const d2 = Temporal.Duration.from(d1);
16 assert.notSameValue(d1, d2);
17 TemporalHelpers.assertDuration(d1, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0);
18 TemporalHelpers.assertDuration(d2, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0);
19
20 reportCompare(0, 0);