Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDate/limits.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) 2021 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.plaindate
7 description: Limits for the PlainDate constructor.
8 includes: [temporalHelpers.js]
9 features: [Temporal]
10 ---*/
11
12 assert.throws(RangeError, () => new Temporal.PlainDate(-271821, 4, 18), "min");
13 assert.throws(RangeError, () => new Temporal.PlainDate(275760, 9, 14), "max");
14 TemporalHelpers.assertPlainDate(new Temporal.PlainDate(-271821, 4, 19),
15 -271821, 4, "M04", 19, "min");
16 TemporalHelpers.assertPlainDate(new Temporal.PlainDate(275760, 9, 13),
17 275760, 9, "M09", 13, "max");
18
19 reportCompare(0, 0);