summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/subclass.js
blob: 54360455db04f7b1aff6b15eeb44080a280f9fe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |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.zoneddatetime
description: Test for Temporal.ZonedDateTime subclassing.
features: [Temporal]
---*/

class CustomZonedDateTime extends Temporal.ZonedDateTime {
}

const instance = new CustomZonedDateTime(0n, "UTC");
assert.sameValue(instance.epochNanoseconds, 0n);
assert.sameValue(Object.getPrototypeOf(instance), CustomZonedDateTime.prototype, "Instance of CustomZonedDateTime");
assert(instance instanceof CustomZonedDateTime, "Instance of CustomZonedDateTime");
assert(instance instanceof Temporal.ZonedDateTime, "Instance of Temporal.ZonedDateTime");

reportCompare(0, 0);