summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js
blob: 2d03d4aa6df155d9c05594752910b29fa998256b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);