blob: 9ad3acf10a168c549805a24f9ed6d21d5061158c [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.add
description: A non-integer value for any recognized property in the property bag, throws a RangeError
features: [Temporal]
---*/
const instance = new Temporal.PlainTime(15, 30, 45, 987, 654, 321);
const fields = [
"years",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds",
"microseconds",
"nanoseconds",
];
fields.forEach((field) => {
assert.throws(RangeError, () => instance.add({ [field]: 1.5 }));
assert.throws(RangeError, () => instance.add({ [field]: -1.5 }));
});