Bug 1904139 - Don't re-initialize platform font list from GetDefaultFont. r=jfkthame
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / ZonedDateTime / prototype / equals / argument-propertybag-timezone-getoffsetnanosecondsfor-not-callable.js
blob84360d9b7bb89dd7abf88b45edd26d2a5569a9da
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.
5 /*---
6 esid: sec-temporal.zoneddatetime.prototype.equals
7 description: TypeError thrown if timeZone.getOffsetNanosecondsFor is not callable
8 features: [BigInt, Symbol, Temporal, arrow-function]
9 ---*/
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 () {
15     return [];
16   };
17   timeZone.getOffsetNanosecondsFor = notCallable;
18   assert.throws(
19     TypeError,
20     () => datetime.equals({ year: 2000, month: 5, day: 2, hour: 12, timeZone }),
21     `Uncallable ${notCallable === null ? 'null' : typeof notCallable} getOffsetNanosecondsFor should throw TypeError`
22   );
23 });
25 reportCompare(0, 0);