Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-string-leap-second.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
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: Leap second is replaced by :59 in ISO strings.
8 includes: [temporalHelpers.js]
9 features: [Temporal]
10 ---*/
11
12 for (const options of [undefined, {}, { overflow: "constrain" }, { overflow: "reject" }]) {
13 TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("23:59:60", options),
14 23, 59, 59, 0, 0, 0);
15 TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("12:30:60", options),
16 12, 30, 59, 0, 0, 0);
17 TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("23:59:60.170", options),
18 23, 59, 59, 170, 0, 0);
19 }
20
21 reportCompare(0, 0);