Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-plaindate.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.plaindatetime.from
7 description: Fast path for converting Temporal.PlainDate to Temporal.PlainDateTime by reading internal slots
8 info: |
9 sec-temporal.plaindatetime.from step 3:
10 3. Return ? ToTemporalDateTime(_item_, _options_).
11 sec-temporal-totemporaldatetime step 2.b:
12 b. If _item_ has an [[InitializedTemporalDate]] internal slot, then
13 i. Return ? CreateTemporalDateTime(_item_.[[ISOYear]], _item_.[[ISOMonth]], _item_.[[ISODay]], 0, 0, 0, 0, 0, 0, _item_.[[Calendar]]).
14 includes: [compareArray.js, temporalHelpers.js]
15 features: [Temporal]
16 ---*/
17
18 TemporalHelpers.checkToTemporalPlainDateTimeFastPath((date) => {
19 const result = Temporal.PlainDateTime.from(date);
20 TemporalHelpers.assertPlainDateTime(result, 2000, 5, "M05", 2, 0, 0, 0, 0, 0, 0, "midnight is assumed");
21 assert.sameValue(result.calendarId, "iso8601", "calendar result");
22 });
23
24 reportCompare(0, 0);