Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / ZonedDateTime / prototype / equals / argument-propertybag-calendar-year-zero.js
blob196e992b0858b8808ba222b33e14ec07972983d0
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.zoneddatetime.prototype.equals
7 description: Negative zero, as an extended year, is rejected
8 features: [Temporal, arrow-function]
9 ---*/
11 const invalidStrings = [
12   "-000000-10-31",
13   "-000000-10-31T17:45",
14   "-000000-10-31T17:45Z",
15   "-000000-10-31T17:45+01:00",
16   "-000000-10-31T17:45+00:00[UTC]",
18 const timeZone = new Temporal.TimeZone("UTC");
19 const instance = new Temporal.ZonedDateTime(0n, timeZone);
20 invalidStrings.forEach((str) => {
21   const arg = { year: 1976, month: 11, day: 18, calendar: str };
22   assert.throws(
23     RangeError,
24     () => instance.equals(arg),
25     "reject minus zero as extended year"
26   );
27 });
29 reportCompare(0, 0);