summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/subclass.js
blob: 6b7dc1d85057f576ed01b66c7e78b7eea542ea40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.plainyearmonth
description: Test for Temporal.PlainYearMonth subclassing.
includes: [temporalHelpers.js]
features: [Temporal]
---*/

class CustomPlainYearMonth extends Temporal.PlainYearMonth {
}

const instance = new CustomPlainYearMonth(2000, 5);
TemporalHelpers.assertPlainYearMonth(instance, 2000, 5, "M05");
assert.sameValue(Object.getPrototypeOf(instance), CustomPlainYearMonth.prototype, "Instance of CustomPlainYearMonth");
assert(instance instanceof CustomPlainYearMonth, "Instance of CustomPlainYearMonth");
assert(instance instanceof Temporal.PlainYearMonth, "Instance of Temporal.PlainYearMonth");

reportCompare(0, 0);