Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-plaindatetime.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.plaindate.from
7 description: Fast path for converting Temporal.PlainDateTime to Temporal.PlainDate by reading internal slots
8 info: |
9 sec-temporal.plaindate.from step 3:
10 3. Return ? ToTemporalDate(_item_, _options_).
11 sec-temporal-totemporaldate step 2.b:
12 b. If _item_ has an [[InitializedTemporalDateTime]] internal slot, then
13 i. Return ! CreateTemporalDate(_item_.[[ISOYear]], _item_.[[ISOMonth]], _item_.[[ISODay]], _item_.[[Calendar]]).
14 includes: [compareArray.js, temporalHelpers.js]
15 features: [Temporal]
16 ---*/
17
18 TemporalHelpers.checkPlainDateTimeConversionFastPath((datetime) => {
19 const result = Temporal.PlainDate.from(datetime);
20 TemporalHelpers.assertPlainDate(result, 2000, 5, "M05", 2);
21 });
22
23 reportCompare(0, 0);