summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-monthCode-day.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-monthCode-day.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-monthCode-day.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-monthCode-day.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-monthCode-day.js
new file mode 100644
index 0000000000..ff07ed1935
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-monthCode-day.js
@@ -0,0 +1,25 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-temporal.calendar.prototype.datefromfields
+description: Temporal.Calendar.prototype.dateFromFields with year, monthCode and day.
+info: |
+ 1. Let calendar be the this value.
+ 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
+ 3. Assert: calendar.[[Identifier]] is "iso8601".
+ 4. If Type(fields) is not Object, throw a TypeError exception.
+ 5. Set options to ? GetOptionsObject(options).
+ 6. Let result be ? ISODateFromFields(fields, options).
+ 7. Return ? CreateTemporalDate(result.[[Year]], result.[[Month]], result.[[Day]], calendar).
+features: [Temporal]
+includes: [temporalHelpers.js]
+---*/
+let cal = new Temporal.Calendar("iso8601")
+
+TemporalHelpers.assertPlainDate(
+ cal.dateFromFields({year: 2021, monthCode: "M07", day: 15}),
+ 2021, 7, "M07", 15,
+ "year/monthCode/day");
+
+reportCompare(0, 0);