argument-plaintime.js (731B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2022 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: A PlainTime object is copied, not returned directly 8 includes: [temporalHelpers.js] 9 features: [Temporal] 10 ---*/ 11 12 const orig = new Temporal.PlainTime(11, 42, 0, 0, 0, 0); 13 const result = Temporal.PlainTime.from(orig); 14 15 TemporalHelpers.assertPlainTime( 16 result, 17 11, 42, 0, 0, 0, 0, 18 "PlainTime is copied" 19 ); 20 21 assert.notSameValue( 22 result, 23 orig, 24 "When a PlainTime is given, the returned value is not the original PlainTime" 25 ); 26 27 reportCompare(0, 0);