mirror of
https://github.com/tc39/test262.git
synced 2025-12-02 11:33:15 +01:00
These tests confirm that Temporal-object-like property bags have the correct default values for their optional properties. This provides coverage for a V8 bug: https://issues.chromium.org/issues/446728405
32 lines
844 B
JavaScript
32 lines
844 B
JavaScript
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.plaindatetime.from
|
|
description: >
|
|
A property bag missing optional properties is equivalent to a property bag
|
|
with all the optional properties having their default values
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const minimumProperties = {
|
|
year: 2021,
|
|
month: 10,
|
|
day: 28,
|
|
};
|
|
const allProperties = {
|
|
year: 2021,
|
|
month: 10,
|
|
day: 28,
|
|
hour: 0,
|
|
minute: 0,
|
|
second: 0,
|
|
millisecond: 0,
|
|
microsecond: 0,
|
|
nanosecond: 0,
|
|
calendar: "iso8601",
|
|
};
|
|
const resultWithout = Temporal.PlainDateTime.from(minimumProperties);
|
|
const resultWith = Temporal.PlainDateTime.from(allProperties);
|
|
assert(resultWithout.equals(resultWith), "results should be the same with and without optional properties");
|