Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainYearMonth / prototype / toPlainDate / calendar-fromfields-called-with-undefined-options.js
blob0edd3b289fbe3b35f53f3d7cbea57f0601d7a57f
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2024 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-temporal.plainyearmonth.prototype.toplaindate
7 description: Calendar.dateFromFields method is called with undefined options
8 features: [Temporal]
9 ---*/
11 let count = 0;
13 const calendar = new class extends Temporal.Calendar {
14   dateFromFields(fields, options) {
15     count++;
16     assert.sameValue(options, undefined, "dateFromFields should be called with undefined options");
17     return super.dateFromFields(fields, options);
18   }
19 }("iso8601");
21 const instance = new Temporal.PlainYearMonth(2000, 5, calendar);
22 instance.toPlainDate({ day: 24 });
23 assert.sameValue(count, 1, "dateFromFields should have been called on the calendar");
25 reportCompare(0, 0);