v8/test/mjsunit/temporal/calendar-constructor.js
Frank Tang f811e89269 [Temporal] Part2 Add constructor and simple getters.
Bug: v8:11544

Change-Id: I3206ca3e0c505b14e4497ccb2af25a31940a1c1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2967755
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78518}
2022-01-07 19:18:33 +00:00

17 lines
594 B
JavaScript

// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-temporal
// https://tc39.es/proposal-temporal/#sec-temporal.calendar
// 1. If NewTarget is undefined, then
// a. Throw a TypeError exception.
assertThrows(() => Temporal.Calendar("iso8601"), TypeError);
assertThrows(() => new Temporal.Calendar(), RangeError);
// Wrong case
assertThrows(() => new Temporal.Calendar("ISO8601"), RangeError);
assertEquals("iso8601", (new Temporal.Calendar("iso8601")).id)