summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainDate/limits.js
blob: 10fb6a5e249f91eddbb16a6dbc5ed7491fa36cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.plaindate
description: Limits for the PlainDate constructor.
includes: [temporalHelpers.js]
features: [Temporal]
---*/

assert.throws(RangeError, () => new Temporal.PlainDate(-271821, 4, 18), "min");
assert.throws(RangeError, () => new Temporal.PlainDate(275760, 9, 14), "max");
TemporalHelpers.assertPlainDate(new Temporal.PlainDate(-271821, 4, 19),
  -271821, 4, "M04", 19, "min");
TemporalHelpers.assertPlainDate(new Temporal.PlainDate(275760, 9, 13),
  275760, 9, "M09", 13, "max");

reportCompare(0, 0);