Bug 1905259 - Add updated thumbs up and down icons, add CSS animation to active state...
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainMonthDay / prototype / toPlainDate / calendar-merge-fields-returns-primitive.js
blobe70303d0dab8674255178de09f0a63e63adcca43
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2021 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.plainmonthday.prototype.toplaindate
7 description: >
8     with() should throw a TypeError if mergeFields() returns a primitive,
9     without passing the value on to any other calendar methods
10 includes: [compareArray.js, temporalHelpers.js]
11 features: [BigInt, Symbol, Temporal]
12 ---*/
14 [undefined, null, true, 3.14159, "bad value", Symbol("no"), 7n].forEach((primitive) => {
15   const calendar = TemporalHelpers.calendarMergeFieldsReturnsPrimitive(primitive);
16   const instance = new Temporal.PlainMonthDay(5, 2, calendar);
17   assert.throws(TypeError, () => instance.toPlainDate({ year: 2005 }), "bad return from mergeFields() throws");
18   assert.sameValue(calendar.dateFromFieldsCallCount, 0, "dateFromFields() never called");
19 });
21 reportCompare(0, 0);