mirror of
https://github.com/tc39/test262.git
synced 2025-06-25 08:20:28 +02:00
* Create a Temporal.PlainDateTime with all arguments supplied. Migrates some tests that currently exist in the proposal-temporal repo. * Check all data in Temporal.PlainDateTimes, variously constructed Enrich existing tests to check all basic data in the instance of `Temporal.PlainDateTime`, not just a single field. These additional checks were motivated by the migration of existing Demitasse tests in the proposal-temporal repo to test262. The Demitasse tests check more than a single field.
24 lines
782 B
JavaScript
24 lines
782 B
JavaScript
// 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.plaindatetime.compare
|
|
description: Plain object arguments may throw if they do not contain sufficient information
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const dt1 = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789);
|
|
const dt2 = new Temporal.PlainDateTime(2019, 10, 29, 10, 46, 38, 271, 986, 102);
|
|
|
|
assert.throws(
|
|
TypeError,
|
|
() => Temporal.PlainDateTime.compare({ year: 1976 }, dt2),
|
|
"object must contain at least the required properties (first arg)"
|
|
);
|
|
|
|
assert.throws(
|
|
TypeError,
|
|
() => Temporal.PlainDateTime.compare(dt1, { year: 2019 }),
|
|
"object must contain at least the required properties (second arg)"
|
|
);
|