plaintime-propertybag-no-time-units.js (705B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 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.from 7 description: Missing time units in property bag default to 0 8 includes: [temporalHelpers.js] 9 features: [Temporal] 10 ---*/ 11 12 const props = {}; 13 assert.throws(TypeError, () => Temporal.PlainTime.from(props), "TypeError if at least one property is not present"); 14 15 props.minute = 30; 16 const result = Temporal.PlainTime.from(props); 17 TemporalHelpers.assertPlainTime(result, 0, 30, 0, 0, 0, 0, "missing time units default to 0"); 18 19 reportCompare(0, 0);