Backed out 2 changesets (bug 1888310, bug 1884625) for causing failures on browser_ap...
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / ZonedDateTime / prototype / weekOfYear / custom-calendar-weekofyear.js
blob43a7d2ba147b9db5cba2dea594cab80373c1c8b3
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.zoneddatetime.prototype.weekofyear
7 description: >
8   Temporal.ZonedDateTime.prototype.weekOfYear returns undefined for all 
9   custom calendars where weekOfYear() returns undefined.
10 features: [Temporal]
11 ---*/
13 class CustomCalendar extends Temporal.Calendar {
14   constructor() {
15     super("iso8601");
16   }
17   weekOfYear() {
18     return undefined;
19   }
22 const calendar = new CustomCalendar();
23 // Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar);
24 const customCalendarDate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar);
25 assert.sameValue(customCalendarDate.weekOfYear, undefined);
27 reportCompare(0, 0);