blob: 0125f388c39536a423fb875b3da57a05e261b2e4 [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.plaindate.prototype.add
description: A non-integer value for any recognized property in the property bag, throws a RangeError
features: [Temporal]
---*/
const instance = new Temporal.PlainDate(2000, 5, 2);
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 }));
});