blob: 4da3c9ebbc17f96a249af3ac98a0899d0f377cd1 [file] [log] [blame]
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.instant.prototype.tostring
description: TypeError thrown when options argument is a primitive
features: [BigInt, Symbol, Temporal]
---*/
const badOptions = [
null,
true,
"some string",
Symbol(),
1,
2n,
];
const instance = new Temporal.Instant(0n);
for (const value of badOptions) {
assert.throws(TypeError, () => instance.toString(value),
`TypeError on wrong options type ${typeof value}`);
};