mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Adds invalid constuction options
This commit is contained in:
parent
abf437c338
commit
4b7f8b49cc
22
test/built-ins/Temporal/PlainYearMonth/prototype/since/options-invalid.js
vendored
Normal file
22
test/built-ins/Temporal/PlainYearMonth/prototype/since/options-invalid.js
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-temporal.plainyearmonth.prototype.since
|
||||||
|
description: Verify that invalid options are handled correctly.
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const feb20 = new Temporal.PlainYearMonth(2020, 2);
|
||||||
|
const feb21 = new Temporal.PlainYearMonth(2021, 2);
|
||||||
|
|
||||||
|
[
|
||||||
|
null,
|
||||||
|
1,
|
||||||
|
'hello',
|
||||||
|
true,
|
||||||
|
Symbol('foo'),
|
||||||
|
1n
|
||||||
|
].forEach((badOption) =>
|
||||||
|
assert.throws(TypeError, () => feb21.since(feb20, badOption), `${String(badOption)} throws TypeError`)
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user