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 / infinity-throws-rangeerror.js
blob3078b75827ca23379aa7e45c875806052ac902d3
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2020 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 description: Throws a RangeError if any value in the property bag is Infinity or -Infinity
7 esid: sec-temporal.plainmonthday.prototype.toplaindate
8 includes: [compareArray.js, temporalHelpers.js]
9 features: [Temporal]
10 ---*/
12 const instance = new Temporal.PlainMonthDay(5, 2);
14 [Infinity, -Infinity].forEach((inf) => {
15   assert.throws(RangeError, () => instance.toPlainDate({ year: inf }), `year property cannot be ${inf}`);
17   const calls = [];
18   const obj = TemporalHelpers.toPrimitiveObserver(calls, inf, "year");
19   assert.throws(RangeError, () => instance.toPlainDate({ year: obj }));
20   assert.compareArray(calls, ["get year.valueOf", "call year.valueOf"], "it fails after fetching the primitive value");
21 });
23 reportCompare(0, 0);