Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDate/from/with-year-monthCode-day.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 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-temporal.plaindate.from
6 description: Property bag with year, monthCode and day
7 info: |
8 1. Let calendar be the this value.
9 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
10 3. Assert: calendar.[[Identifier]] is "iso8601".
11 4. If Type(fields) is not Object, throw a TypeError exception.
12 5. Set options to ? GetOptionsObject(options).
13 6. Let result be ? ISODateFromFields(fields, options).
14 7. Return ? CreateTemporalDate(result.[[Year]], result.[[Month]], result.[[Day]], calendar).
15 features: [Temporal]
16 includes: [temporalHelpers.js]
17 ---*/
18
19 TemporalHelpers.assertPlainDate(
20 Temporal.PlainDate.from({year: 2021, monthCode: "M07", day: 15}),
21 2021, 7, "M07", 15,
22 "year/monthCode/day");
23
24 reportCompare(0, 0);