Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainTime/compare/plaintime-propertybag-no-time-units.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.plaintime.compare
7 description: Missing time units in property bag default to 0
8 features: [Temporal]
9 ---*/
10
11 const props = {};
12 assert.throws(TypeError, () => Temporal.PlainTime.compare(props, new Temporal.PlainTime(0, 30)), "TypeError if no properties are present");
13
14 props.minute = 30;
15 const result = Temporal.PlainTime.compare(props, new Temporal.PlainTime(0, 30));
16 assert.sameValue(result, 0, "missing time units default to 0");
17
18 reportCompare(0, 0);