v8/test/mjsunit/temporal/plain-date-time-to-plain-year-month.js
Frank Tang 790d55486b [Temporal] Add some tests for PlainDateTime
Land some of the tests for Temporal.PlainDateTime
All marked as FAIL at this stage.

Bug: v8:11544
Change-Id: I09bf681e61f19d96607c848ddcb6bee06580aff1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3085625
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77332}
2021-10-12 08:48:20 +00:00

13 lines
503 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
d8.file.execute('test/mjsunit/temporal/temporal-helpers.js');
let d1 = new Temporal.PlainDateTime(2021, 12, 11, 1,2,3,4,5,6);
let badDateTime = { toPlainYearMonth: d1.toPlainYearMonth }
assertThrows(() => badDateTime.toPlainYearMonth(), TypeError);
assertPlainYearMonth(d1.toPlainYearMonth(), 2021, 12);