8e3b455f53
This cl only convert the part for calendar in PR2395. The part to cover TimeZone change will be coded in another cl. Spec Text: https://tc39.es/proposal-temporal/#sec-temporal-isbuiltincalendar Spec change https://github.com/tc39/proposal-temporal/pull/2395 PR2395 achieved consensus at the September 2022 TC39 meeting. Also merge unnecessary const std::string& id version of IsBuiltinCalendar to the Handle<String> version and remove the unnecessary version. Bug: v8:11544 Change-Id: Idb711d48dbcf929059b71c48681c03b30089adb0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3901200 Reviewed-by: Adam Klein <adamk@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/main@{#84073}
16 lines
577 B
JavaScript
16 lines
577 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);
|
|
|
|
assertEquals("iso8601", (new Temporal.Calendar("IsO8601")).id)
|
|
|
|
assertEquals("iso8601", (new Temporal.Calendar("iso8601")).id)
|