year-zero.js (680B)
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: Negative zero, as an extended year, is rejected 8 features: [Temporal, arrow-function] 9 ---*/ 10 11 const invalidStrings = [ 12 "-000000-12-07T03:24:30", 13 "-000000-12-07T03:24:30+01:00", 14 "-000000-12-07T03:24:30+00:00[UTC]", 15 ]; 16 17 invalidStrings.forEach((arg) => { 18 assert.throws( 19 RangeError, 20 () => Temporal.PlainTime.from(arg), 21 "reject minus zero as extended year" 22 ); 23 }); 24 25 reportCompare(0, 0);