Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainMonthDay / prototype / equals / year-zero.js
blobbfe6d361dfd37d29eeb3e100e99204c5c6af56e1
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2022 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.equals
7 description: Negative zero, as an extended year, is rejected
8 features: [Temporal, arrow-function]
9 ---*/
11 const invalidStrings = [
12   "-000000-08-24",
13   "-000000-08-24T15:43:27",
14   "-000000-08-24T15:43:27+01:00",
15   "-000000-08-24T15:43:27+00:00[UTC]",
17 const instance = new Temporal.PlainMonthDay(5, 2);
18 invalidStrings.forEach((arg) => {
19   assert.throws(
20     RangeError,
21     () => instance.equals(arg),
22     "reject minus zero as extended year"
23   );
24 });
26 reportCompare(0, 0);