options-invalid.js (622B)
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. 4 5 /*--- 6 esid: sec-temporal.plainmonthday.from 7 description: TypeError thrown when options argument is a primitive 8 features: [BigInt, Symbol, Temporal] 9 ---*/ 10 11 const fields = { month: 2, day: 31 }; 12 13 const values = [null, true, "hello", Symbol("foo"), 1, 1n]; 14 for (const badOptions of values) { 15 assert.throws(TypeError, () => Temporal.PlainMonthDay.from(fields, badOptions)); 16 } 17 18 reportCompare(0, 0);