Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDateTime/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) 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.plaindatetime
7 description: Checking limits of representable PlainDateTime
8 features: [Temporal]
9 ---*/
10
11 assert.throws(
12 RangeError,
13 () => new Temporal.PlainDateTime(-271821, 4, 19, 0, 0, 0, 0, 0, 0),
14 "negative year out of bounds"
15 );
16 assert.throws(
17 RangeError,
18 () => new Temporal.PlainDateTime(275760, 9, 14, 0, 0, 0, 0, 0, 0),
19 "positive year out of bounds"
20 );
21
22 reportCompare(0, 0);