summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/TimeZone/subclass.js
blob: a67e299e3aa74c31e415056e8252c021e54c21ea (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.timezone
description: Test for Temporal.TimeZone subclassing.
features: [Temporal]
---*/

class CustomTimeZone extends Temporal.TimeZone {
}

const instance = new CustomTimeZone("UTC");
assert.sameValue(instance.toString(), "UTC");
assert.sameValue(Object.getPrototypeOf(instance), CustomTimeZone.prototype, "Instance of CustomTimeZone");
assert(instance instanceof CustomTimeZone, "Instance of CustomTimeZone");
assert(instance instanceof Temporal.TimeZone, "Instance of Temporal.TimeZone");

reportCompare(0, 0);