calendar-constructor.js 594 Bytes
Newer Older
1 2 3 4 5 6 7 8
// 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.
9
assertThrows(() => Temporal.Calendar("iso8601"), TypeError);
10

11
assertThrows(() => new Temporal.Calendar(), RangeError);
12 13

// Wrong case
14
assertThrows(() => new Temporal.Calendar("ISO8601"), RangeError);
15 16

assertEquals("iso8601", (new Temporal.Calendar("iso8601")).id)