year-zero.js (618B)
1 // Copyright (C) 2022 Igalia, S.L. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-expanded-years 6 description: Negative zero, as an extended year, is rejected 7 info: | 8 The year 0 is considered positive and must be prefixed with a + sign. The 9 representation of the year 0 as -000000 is invalid. 10 ---*/ 11 12 const invalidStrings = [ 13 "-000000-03-31T00:45Z", 14 "-000000-03-31T01:45", 15 "-000000-03-31T01:45:00+01:00" 16 ]; 17 18 for (const str of invalidStrings) { 19 assert.sameValue(Date.parse(str), NaN, "reject minus zero as extended year"); 20 } 21 22 reportCompare(0, 0);