summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/argument-not-object.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/argument-not-object.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/argument-not-object.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/argument-not-object.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/argument-not-object.js
new file mode 100644
index 0000000000..e97cf63771
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/argument-not-object.js
@@ -0,0 +1,18 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// 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.toplaindate
+description: Throws a TypeError if the argument is not an Object, before any other observable actions
+includes: [compareArray.js, temporalHelpers.js]
+features: [BigInt, Symbol, Temporal]
+---*/
+
+[null, undefined, true, 3.1416, "a string", Symbol("symbol"), 7n].forEach((primitive) => {
+ const calendar = TemporalHelpers.calendarThrowEverything();
+ const plainYearMonth = new Temporal.PlainYearMonth(2000, 5, calendar);
+ assert.throws(TypeError, () => plainYearMonth.toPlainDate(primitive));
+});
+
+reportCompare(0, 0);