summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-string-leap-second.js
blob: f64a291ee307d5e703615fa6671a99c92d31d18b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// |reftest| skip -- Temporal is not supported
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.plaintime.from
description: Leap second is replaced by :59 in ISO strings.
includes: [temporalHelpers.js]
features: [Temporal]
---*/

for (const options of [undefined, {}, { overflow: "constrain" }, { overflow: "reject" }]) {
  TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("23:59:60", options),
    23, 59, 59, 0, 0, 0);
  TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("12:30:60", options),
    12, 30, 59, 0, 0, 0);
  TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("23:59:60.170", options),
    23, 59, 59, 170, 0, 0);
}

reportCompare(0, 0);