blob: 161aa7d25d78b0cf4a75b3f9a191dc244c6ac92c [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.plaindatetime.prototype.add
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
---*/
const add = Temporal.PlainDateTime.prototype.add;
assert.sameValue(typeof add, "function");
assert.throws(TypeError, () => add.call(undefined), "undefined");
assert.throws(TypeError, () => add.call(null), "null");
assert.throws(TypeError, () => add.call(true), "true");
assert.throws(TypeError, () => add.call(""), "empty string");
assert.throws(TypeError, () => add.call(Symbol()), "symbol");
assert.throws(TypeError, () => add.call(1), "1");
assert.throws(TypeError, () => add.call({}), "plain object");
assert.throws(TypeError, () => add.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
assert.throws(TypeError, () => add.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");