Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / Duration / prototype / round / out-of-range-when-converting-from-normalized-duration.js
blob4fde7613510de6017868098c5d7b99e53d88a0cb
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2024 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-temporal.duration.prototype.round
7 description: >
8     When converting the result from normalized duration form, each duration
9     component is turned into a float64-representable integer
10 features: [Temporal]
11 ---*/
13 const d = new Temporal.Duration(0, 0, 0, 0, 0, 0, /* s = */ Number.MAX_SAFE_INTEGER, 0, 0, /* ns = */ 999_999_999);
14 assert.throws(RangeError, () => d.round({
15   largestUnit: "nanoseconds",
16   roundingIncrement: 1,
17 }), "nanoseconds component is an unsafe integer after balancing");
19 reportCompare(0, 0);