diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day.js new file mode 100644 index 0000000000..e24b574004 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-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/month/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, month: 7, day: 15}), + 2021, 7, "M07", 15, + "year/month/day"); + +reportCompare(0, 0); |