summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/timezone-instance-does-not-get-timeZone-property.js
blob: 3a10a79e1a88f955430b593be1941cf034b4fd8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// |reftest| skip -- Temporal is not supported
// 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: >
  A Temporal.TimeZone instance passed to new ZonedDateTime() does not have
  its 'timeZone' property observably checked
features: [Temporal]
---*/

const timeZone = new Temporal.TimeZone("UTC");
Object.defineProperty(timeZone, "timeZone", {
  get() {
    throw new Test262Error("timeZone.timeZone should not be accessed");
  },
});

new Temporal.ZonedDateTime(0n, timeZone);
new Temporal.ZonedDateTime(0n, { timeZone });

reportCompare(0, 0);