Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainDateTime / prototype / weekOfYear / custom-calendar-weekofyear.js
blob97242a19c424bb4dbbe0ca17361166c74694e6a1
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.plaindatetime.prototype.weekofyear
7 description: >
8   Temporal.PlainDateTime.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 const customCalendarDate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar);
24 assert.sameValue(customCalendarDate.weekOfYear, undefined);
26 reportCompare(0, 0);