Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainYearMonth/argument-invalid.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 André Bargull. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.plainyearmonth
7 description: PlainYearMonth constructor with invalid iso dates
8 features: [Temporal]
9 ---*/
10
11 const tests = [
12 [2020, 0, 24],
13 [2020, 13, 24],
14 [2020, -3, 24],
15 [2020, 12, 32],
16 [2020, 2, 30],
17 [2019, 2, 29],
18 [2019, 2, 0],
19 [2019, 2, -20],
20 ];
21
22 for (const [year, month, day] of tests) {
23 assert.throws(RangeError, () => new Temporal.PlainYearMonth(year, month, undefined, day),
24 `year=${year}, month=${month}, day=${day}`);
25 }
26
27 reportCompare(0, 0);