Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/options-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) 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);