mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Tests for the normative change to Temporal made in https://github.com/tc39/proposal-temporal/pull/1862
16 lines
594 B
JavaScript
16 lines
594 B
JavaScript
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.plaintime.compare
|
|
description: Missing time units in property bag default to 0
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const props = {};
|
|
assert.throws(TypeError, () => Temporal.PlainTime.compare(props, new Temporal.PlainTime(0, 30)), "TypeError if at least one property is not present");
|
|
|
|
props.minute = 30;
|
|
const result = Temporal.PlainTime.compare(props, new Temporal.PlainTime(0, 30));
|
|
assert.sameValue(result, 0, "missing time units default to 0");
|