Backed out 2 changesets (bug 1888310, bug 1884625) for causing failures on browser_ap...
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / ZonedDateTime / timezone-string-leap-second.js
blob09113ed5f221cc1521c9b611e75ffde6311a737f
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.
5 /*---
6 esid: sec-temporal.zoneddatetime
7 description: Leap second is a valid ISO string for TimeZone
8 features: [Temporal]
9 ---*/
11 let timeZone = "2016-12-31T23:59:60+00:00[UTC]";
13 const result = new Temporal.ZonedDateTime(0n, timeZone);
14 assert.sameValue(result.timeZoneId, "UTC", "Time zone string determined from bracket name");
16 timeZone = "2021-08-19T17:30:45.123456789+23:59[+23:59:60]";
17 assert.throws(RangeError, () => new Temporal.ZonedDateTime(0n, timeZone), "leap second in time zone name not valid");
19 reportCompare(0, 0);