blob: 8c121696283a9e9f1e016bf69099d4b7bd7bf974 [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.subtract
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.subtract({ [field]: 1.5 }));
assert.throws(RangeError, () => instance.subtract({ [field]: -1.5 }));
});