1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-temporal.zoneddatetime.prototype.equals
7 description: TypeError thrown if timeZone.getOffsetNanosecondsFor is not callable
8 features: [BigInt, Symbol, Temporal, arrow-function]
11 [undefined, null, true, Math.PI, 'string', Symbol('sym'), 42n, {}].forEach((notCallable) => {
12 const timeZone = new Temporal.TimeZone("UTC");
13 const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC");
14 timeZone.getPossibleInstantsFor = function () {
17 timeZone.getOffsetNanosecondsFor = notCallable;
20 () => datetime.equals({ year: 2000, month: 5, day: 2, hour: 12, timeZone }),
21 `Uncallable ${notCallable === null ? 'null' : typeof notCallable} getOffsetNanosecondsFor should throw TypeError`