summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/subclass.js
blob: 8040302fb0d51896ffb8347243f70373e72a35f3 (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.plainmonthday
description: Test for Temporal.PlainMonthDay subclassing.
includes: [temporalHelpers.js]
features: [Temporal]
---*/

class CustomPlainMonthDay extends Temporal.PlainMonthDay {
}

const instance = new CustomPlainMonthDay(5, 2);
TemporalHelpers.assertPlainMonthDay(instance, "M05", 2);
assert.sameValue(Object.getPrototypeOf(instance), CustomPlainMonthDay.prototype, "Instance of CustomPlainMonthDay");
assert(instance instanceof CustomPlainMonthDay, "Instance of CustomPlainMonthDay");
assert(instance instanceof Temporal.PlainMonthDay, "Instance of Temporal.PlainMonthDay");

reportCompare(0, 0);