Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainMonthDay/subclass.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2022 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.plainmonthday
7 description: Test for Temporal.PlainMonthDay subclassing.
8 includes: [temporalHelpers.js]
9 features: [Temporal]
10 ---*/
11
12 class CustomPlainMonthDay extends Temporal.PlainMonthDay {
13 }
14
15 const instance = new CustomPlainMonthDay(5, 2);
16 TemporalHelpers.assertPlainMonthDay(instance, "M05", 2);
17 assert.sameValue(Object.getPrototypeOf(instance), CustomPlainMonthDay.prototype, "Instance of CustomPlainMonthDay");
18 assert(instance instanceof CustomPlainMonthDay, "Instance of CustomPlainMonthDay");
19 assert(instance instanceof Temporal.PlainMonthDay, "Instance of Temporal.PlainMonthDay");
20
21 reportCompare(0, 0);