argument-invalid.js (697B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2022 Igalia, S.L. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-temporal.plaindate 7 description: PlainDate 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.PlainDate(year, month, day), 24 `year=${year}, month=${month}, day=${day}`); 25 } 26 27 reportCompare(0, 0);