tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

timezone-string-leap-second.js (742B)


      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.now.plaindateiso
      7 description: Leap second is a valid ISO string for TimeZone
      8 features: [Temporal]
      9 ---*/
     10 
     11 let timeZone = "2016-12-31T23:59:60+00:00[UTC]";
     12 
     13 // A string with a leap second is a valid ISO string, so the following
     14 // operation should not throw
     15 
     16 Temporal.Now.plainDateISO(timeZone);
     17 
     18 timeZone = "2021-08-19T17:30:45.123456789+23:59[+23:59:60]";
     19 assert.throws(RangeError, () => Temporal.Now.plainDateISO(timeZone), "leap second in time zone name not valid");
     20 
     21 reportCompare(0, 0);