Bug 1899500 - Implement explicit resource management in Baseline compiler. r=arai
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / ZonedDateTime / prototype / toLocaleString / branding.js
bloba59ba2cebb2d828c2d6f461512a9a94aae34722c
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.tolocalestring
7 description: Throw a TypeError if the receiver is invalid
8 features: [Symbol, Temporal]
9 ---*/
11 const toLocaleString = Temporal.ZonedDateTime.prototype.toLocaleString;
13 assert.sameValue(typeof toLocaleString, "function");
15 assert.throws(TypeError, () => toLocaleString.call(undefined), "undefined");
16 assert.throws(TypeError, () => toLocaleString.call(null), "null");
17 assert.throws(TypeError, () => toLocaleString.call(true), "true");
18 assert.throws(TypeError, () => toLocaleString.call(""), "empty string");
19 assert.throws(TypeError, () => toLocaleString.call(Symbol()), "symbol");
20 assert.throws(TypeError, () => toLocaleString.call(1), "1");
21 assert.throws(TypeError, () => toLocaleString.call({}), "plain object");
22 assert.throws(TypeError, () => toLocaleString.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime");
23 assert.throws(TypeError, () => toLocaleString.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype");
25 reportCompare(0, 0);