Skip to content

Commit

Permalink
Temporal: Add test for Duration/p/toString() with total time units ou…
Browse files Browse the repository at this point in the history
…t of range
  • Loading branch information
catamorphism authored and Ms2ger committed Nov 6, 2024
1 parent 38d52c9 commit 58e149d
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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.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 }));

0 comments on commit 58e149d

Please sign in to comment.