mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Temporal: Add test for Duration/p/toString() with total time units out of range (#4313)
This commit is contained in:
parent
38d52c9a60
commit
b2809feedf
13
test/built-ins/Temporal/Duration/prototype/toString/total-of-duration-time-units-out-of-range.js
vendored
Normal file
13
test/built-ins/Temporal/Duration/prototype/toString/total-of-duration-time-units-out-of-range.js
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.duration.prototype.tostring
|
||||
description: Throws when rounding and total of duration time units is out of range.
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const duration = new Temporal.Duration(0, 0, 0, 1, 0, 0, 2**53 - 1 - (24*60*60), 0, 0, 999_999_999);
|
||||
|
||||
assert.throws(RangeError,
|
||||
() => duration.toString({ roundingMode: "ceil", fractionalSecondDigits: 7 }));
|
Loading…
x
Reference in New Issue
Block a user