Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / Duration / prototype / round / out-of-range-when-converting-from-normalized-duration.js
blobd4f973d639cee8d4ac73062c92e5e4a9935b05c8
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 after balancing as a float64-representable integer is out of range");
19 reportCompare(0, 0);