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.
6 esid: sec-get-temporal.zoneddatetime.prototype.weekofyear
7 description: Validate result returned from calendar weekOfYear() method
14 [Infinity, RangeError],
15 [-Infinity, RangeError],
19 ["string", TypeError],
20 [Symbol("foo"), TypeError],
27 [{valueOf() { return 7; }}, TypeError],
30 badResults.forEach(([result, error]) => {
31 const calendar = new class extends Temporal.Calendar {
36 const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", calendar);
37 assert.throws(error, () => instance.weekOfYear, `${typeof result} ${String(result)} not converted to positive integer`);