blob: c292460f3907e0aada14c79229bc5d4a7fe349e7 [file] [log] [blame]
// 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.plaintime.prototype.round
description: RangeError thrown when roundingIncrement option is NaN
info: |
sec-getoption step 8.b:
b. If _value_ is *NaN*, throw a *RangeError* exception.
sec-temporal-totemporalroundingincrement step 5:
5. Let _increment_ be ? GetOption(_normalizedOptions_, *"roundingIncrement"*, « Number », *undefined*, 1).
sec-temporal.plaintime.prototype.round step 11:
10. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*).
features: [Temporal]
---*/
const time = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
assert.throws(RangeError, () => time.round({ smallestUnit: 'second', roundingIncrement: NaN }));