summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js
new file mode 100644
index 0000000000..2d03d4aa6d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js
@@ -0,0 +1,23 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.month
+description: >
+ Temporal.Calendar.prototype.month throws TypeError if temporalDateLike
+ is a PlainMonthDay object.
+ ToTemporalDate when temporalDateLike is invalid string.
+info: |
+ 4. If Type(temporalDateLike) is Object and temporalDateLike has an
+ [[InitializedTemporalMonthDay]] internal slot, then
+ a. Throw a TypeError exception.
+features: [Temporal, arrow-function]
+---*/
+let cal = new Temporal.Calendar("iso8601");
+
+let monthDay = new Temporal.PlainMonthDay(12, 25);
+assert.throws(TypeError, () => cal.month(monthDay),
+ 'cal.month(monthDay) throws a TypeError exception');
+
+reportCompare(0, 0);