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