mirror of https://github.com/tc39/test262.git
Add branding tests from Temporal (#3138)
Closes: #3137 Co-authored-by: Ms2ger <Ms2ger@igalia.com>
This commit is contained in:
parent
69262f6743
commit
45a913c057
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.dateadd
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dateAdd = Temporal.Calendar.prototype.dateAdd;
|
||||
|
||||
assert.sameValue(typeof dateAdd, "function");
|
||||
|
||||
assert.throws(TypeError, () => dateAdd.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dateAdd.call(null), "null");
|
||||
assert.throws(TypeError, () => dateAdd.call(true), "true");
|
||||
assert.throws(TypeError, () => dateAdd.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dateAdd.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dateAdd.call(1), "1");
|
||||
assert.throws(TypeError, () => dateAdd.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dateAdd.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateAdd.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.datefromfields
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dateFromFields = Temporal.Calendar.prototype.dateFromFields;
|
||||
|
||||
assert.sameValue(typeof dateFromFields, "function");
|
||||
|
||||
assert.throws(TypeError, () => dateFromFields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dateFromFields.call(null), "null");
|
||||
assert.throws(TypeError, () => dateFromFields.call(true), "true");
|
||||
assert.throws(TypeError, () => dateFromFields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dateFromFields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dateFromFields.call(1), "1");
|
||||
assert.throws(TypeError, () => dateFromFields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dateFromFields.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateFromFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.dateuntil
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dateUntil = Temporal.Calendar.prototype.dateUntil;
|
||||
|
||||
assert.sameValue(typeof dateUntil, "function");
|
||||
|
||||
assert.throws(TypeError, () => dateUntil.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dateUntil.call(null), "null");
|
||||
assert.throws(TypeError, () => dateUntil.call(true), "true");
|
||||
assert.throws(TypeError, () => dateUntil.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dateUntil.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dateUntil.call(1), "1");
|
||||
assert.throws(TypeError, () => dateUntil.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dateUntil.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateUntil.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.day
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const day = Temporal.Calendar.prototype.day;
|
||||
|
||||
assert.sameValue(typeof day, "function");
|
||||
|
||||
assert.throws(TypeError, () => day.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => day.call(null), "null");
|
||||
assert.throws(TypeError, () => day.call(true), "true");
|
||||
assert.throws(TypeError, () => day.call(""), "empty string");
|
||||
assert.throws(TypeError, () => day.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => day.call(1), "1");
|
||||
assert.throws(TypeError, () => day.call({}), "plain object");
|
||||
assert.throws(TypeError, () => day.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => day.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.dayofweek
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dayOfWeek = Temporal.Calendar.prototype.dayOfWeek;
|
||||
|
||||
assert.sameValue(typeof dayOfWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.dayofyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dayOfYear = Temporal.Calendar.prototype.dayOfYear;
|
||||
|
||||
assert.sameValue(typeof dayOfYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfYear.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfYear.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfYear.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.daysinmonth
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInMonth = Temporal.Calendar.prototype.daysInMonth;
|
||||
|
||||
assert.sameValue(typeof daysInMonth, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInMonth.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInMonth.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInMonth.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInMonth.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInMonth.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInMonth.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.daysinweek
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInWeek = Temporal.Calendar.prototype.daysInWeek;
|
||||
|
||||
assert.sameValue(typeof daysInWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.daysinyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInYear = Temporal.Calendar.prototype.daysInYear;
|
||||
|
||||
assert.sameValue(typeof daysInYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInYear.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInYear.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInYear.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.era
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const era = Temporal.Calendar.prototype.era;
|
||||
|
||||
assert.sameValue(typeof era, "function");
|
||||
|
||||
assert.throws(TypeError, () => era.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => era.call(null), "null");
|
||||
assert.throws(TypeError, () => era.call(true), "true");
|
||||
assert.throws(TypeError, () => era.call(""), "empty string");
|
||||
assert.throws(TypeError, () => era.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => era.call(1), "1");
|
||||
assert.throws(TypeError, () => era.call({}), "plain object");
|
||||
assert.throws(TypeError, () => era.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => era.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.erayear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const eraYear = Temporal.Calendar.prototype.eraYear;
|
||||
|
||||
assert.sameValue(typeof eraYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => eraYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => eraYear.call(null), "null");
|
||||
assert.throws(TypeError, () => eraYear.call(true), "true");
|
||||
assert.throws(TypeError, () => eraYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => eraYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => eraYear.call(1), "1");
|
||||
assert.throws(TypeError, () => eraYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => eraYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => eraYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.fields
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const fields = Temporal.Calendar.prototype.fields;
|
||||
|
||||
assert.sameValue(typeof fields, "function");
|
||||
|
||||
assert.throws(TypeError, () => fields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => fields.call(null), "null");
|
||||
assert.throws(TypeError, () => fields.call(true), "true");
|
||||
assert.throws(TypeError, () => fields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => fields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => fields.call(1), "1");
|
||||
assert.throws(TypeError, () => fields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => fields.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => fields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.inleapyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const inLeapYear = Temporal.Calendar.prototype.inLeapYear;
|
||||
|
||||
assert.sameValue(typeof inLeapYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => inLeapYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => inLeapYear.call(null), "null");
|
||||
assert.throws(TypeError, () => inLeapYear.call(true), "true");
|
||||
assert.throws(TypeError, () => inLeapYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => inLeapYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => inLeapYear.call(1), "1");
|
||||
assert.throws(TypeError, () => inLeapYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => inLeapYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => inLeapYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.mergefields
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const mergeFields = Temporal.Calendar.prototype.mergeFields;
|
||||
|
||||
assert.sameValue(typeof mergeFields, "function");
|
||||
|
||||
assert.throws(TypeError, () => mergeFields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => mergeFields.call(null), "null");
|
||||
assert.throws(TypeError, () => mergeFields.call(true), "true");
|
||||
assert.throws(TypeError, () => mergeFields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => mergeFields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => mergeFields.call(1), "1");
|
||||
assert.throws(TypeError, () => mergeFields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => mergeFields.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => mergeFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.month
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const month = Temporal.Calendar.prototype.month;
|
||||
|
||||
assert.sameValue(typeof month, "function");
|
||||
|
||||
assert.throws(TypeError, () => month.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => month.call(null), "null");
|
||||
assert.throws(TypeError, () => month.call(true), "true");
|
||||
assert.throws(TypeError, () => month.call(""), "empty string");
|
||||
assert.throws(TypeError, () => month.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => month.call(1), "1");
|
||||
assert.throws(TypeError, () => month.call({}), "plain object");
|
||||
assert.throws(TypeError, () => month.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => month.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.monthcode
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const monthCode = Temporal.Calendar.prototype.monthCode;
|
||||
|
||||
assert.sameValue(typeof monthCode, "function");
|
||||
|
||||
assert.throws(TypeError, () => monthCode.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => monthCode.call(null), "null");
|
||||
assert.throws(TypeError, () => monthCode.call(true), "true");
|
||||
assert.throws(TypeError, () => monthCode.call(""), "empty string");
|
||||
assert.throws(TypeError, () => monthCode.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => monthCode.call(1), "1");
|
||||
assert.throws(TypeError, () => monthCode.call({}), "plain object");
|
||||
assert.throws(TypeError, () => monthCode.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => monthCode.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.monthdayfromfields
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const monthDayFromFields = Temporal.Calendar.prototype.monthDayFromFields;
|
||||
|
||||
assert.sameValue(typeof monthDayFromFields, "function");
|
||||
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(null), "null");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(true), "true");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(1), "1");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => monthDayFromFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.monthsinyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const monthsInYear = Temporal.Calendar.prototype.monthsInYear;
|
||||
|
||||
assert.sameValue(typeof monthsInYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => monthsInYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => monthsInYear.call(null), "null");
|
||||
assert.throws(TypeError, () => monthsInYear.call(true), "true");
|
||||
assert.throws(TypeError, () => monthsInYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => monthsInYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => monthsInYear.call(1), "1");
|
||||
assert.throws(TypeError, () => monthsInYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => monthsInYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => monthsInYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.tostring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toString = Temporal.Calendar.prototype.toString;
|
||||
|
||||
assert.sameValue(typeof toString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toString.call(null), "null");
|
||||
assert.throws(TypeError, () => toString.call(true), "true");
|
||||
assert.throws(TypeError, () => toString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toString.call(1), "1");
|
||||
assert.throws(TypeError, () => toString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.weekofyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const weekOfYear = Temporal.Calendar.prototype.weekOfYear;
|
||||
|
||||
assert.sameValue(typeof weekOfYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => weekOfYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => weekOfYear.call(null), "null");
|
||||
assert.throws(TypeError, () => weekOfYear.call(true), "true");
|
||||
assert.throws(TypeError, () => weekOfYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => weekOfYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => weekOfYear.call(1), "1");
|
||||
assert.throws(TypeError, () => weekOfYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => weekOfYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => weekOfYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.year
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const year = Temporal.Calendar.prototype.year;
|
||||
|
||||
assert.sameValue(typeof year, "function");
|
||||
|
||||
assert.throws(TypeError, () => year.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => year.call(null), "null");
|
||||
assert.throws(TypeError, () => year.call(true), "true");
|
||||
assert.throws(TypeError, () => year.call(""), "empty string");
|
||||
assert.throws(TypeError, () => year.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => year.call(1), "1");
|
||||
assert.throws(TypeError, () => year.call({}), "plain object");
|
||||
assert.throws(TypeError, () => year.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => year.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.calendar.prototype.yearmonthfromfields
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const yearMonthFromFields = Temporal.Calendar.prototype.yearMonthFromFields;
|
||||
|
||||
assert.sameValue(typeof yearMonthFromFields, "function");
|
||||
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(null), "null");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(true), "true");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(1), "1");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => yearMonthFromFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.abs
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const abs = Temporal.Duration.prototype.abs;
|
||||
|
||||
assert.sameValue(typeof abs, "function");
|
||||
|
||||
assert.throws(TypeError, () => abs.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => abs.call(null), "null");
|
||||
assert.throws(TypeError, () => abs.call(true), "true");
|
||||
assert.throws(TypeError, () => abs.call(""), "empty string");
|
||||
assert.throws(TypeError, () => abs.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => abs.call(1), "1");
|
||||
assert.throws(TypeError, () => abs.call({}), "plain object");
|
||||
assert.throws(TypeError, () => abs.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => abs.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.add
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const add = Temporal.Duration.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.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => add.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.blank
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const blank = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "blank").get;
|
||||
|
||||
assert.sameValue(typeof blank, "function");
|
||||
|
||||
assert.throws(TypeError, () => blank.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => blank.call(null), "null");
|
||||
assert.throws(TypeError, () => blank.call(true), "true");
|
||||
assert.throws(TypeError, () => blank.call(""), "empty string");
|
||||
assert.throws(TypeError, () => blank.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => blank.call(1), "1");
|
||||
assert.throws(TypeError, () => blank.call({}), "plain object");
|
||||
assert.throws(TypeError, () => blank.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => blank.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.days
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const days = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "days").get;
|
||||
|
||||
assert.sameValue(typeof days, "function");
|
||||
|
||||
assert.throws(TypeError, () => days.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => days.call(null), "null");
|
||||
assert.throws(TypeError, () => days.call(true), "true");
|
||||
assert.throws(TypeError, () => days.call(""), "empty string");
|
||||
assert.throws(TypeError, () => days.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => days.call(1), "1");
|
||||
assert.throws(TypeError, () => days.call({}), "plain object");
|
||||
assert.throws(TypeError, () => days.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => days.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.hours
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const hours = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "hours").get;
|
||||
|
||||
assert.sameValue(typeof hours, "function");
|
||||
|
||||
assert.throws(TypeError, () => hours.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => hours.call(null), "null");
|
||||
assert.throws(TypeError, () => hours.call(true), "true");
|
||||
assert.throws(TypeError, () => hours.call(""), "empty string");
|
||||
assert.throws(TypeError, () => hours.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => hours.call(1), "1");
|
||||
assert.throws(TypeError, () => hours.call({}), "plain object");
|
||||
assert.throws(TypeError, () => hours.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => hours.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.microseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const microseconds = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "microseconds").get;
|
||||
|
||||
assert.sameValue(typeof microseconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => microseconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => microseconds.call(null), "null");
|
||||
assert.throws(TypeError, () => microseconds.call(true), "true");
|
||||
assert.throws(TypeError, () => microseconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => microseconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => microseconds.call(1), "1");
|
||||
assert.throws(TypeError, () => microseconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => microseconds.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => microseconds.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.milliseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const milliseconds = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "milliseconds").get;
|
||||
|
||||
assert.sameValue(typeof milliseconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => milliseconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => milliseconds.call(null), "null");
|
||||
assert.throws(TypeError, () => milliseconds.call(true), "true");
|
||||
assert.throws(TypeError, () => milliseconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => milliseconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => milliseconds.call(1), "1");
|
||||
assert.throws(TypeError, () => milliseconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => milliseconds.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => milliseconds.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.minutes
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const minutes = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "minutes").get;
|
||||
|
||||
assert.sameValue(typeof minutes, "function");
|
||||
|
||||
assert.throws(TypeError, () => minutes.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => minutes.call(null), "null");
|
||||
assert.throws(TypeError, () => minutes.call(true), "true");
|
||||
assert.throws(TypeError, () => minutes.call(""), "empty string");
|
||||
assert.throws(TypeError, () => minutes.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => minutes.call(1), "1");
|
||||
assert.throws(TypeError, () => minutes.call({}), "plain object");
|
||||
assert.throws(TypeError, () => minutes.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => minutes.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.months
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const months = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "months").get;
|
||||
|
||||
assert.sameValue(typeof months, "function");
|
||||
|
||||
assert.throws(TypeError, () => months.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => months.call(null), "null");
|
||||
assert.throws(TypeError, () => months.call(true), "true");
|
||||
assert.throws(TypeError, () => months.call(""), "empty string");
|
||||
assert.throws(TypeError, () => months.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => months.call(1), "1");
|
||||
assert.throws(TypeError, () => months.call({}), "plain object");
|
||||
assert.throws(TypeError, () => months.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => months.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.nanoseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const nanoseconds = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "nanoseconds").get;
|
||||
|
||||
assert.sameValue(typeof nanoseconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => nanoseconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => nanoseconds.call(null), "null");
|
||||
assert.throws(TypeError, () => nanoseconds.call(true), "true");
|
||||
assert.throws(TypeError, () => nanoseconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => nanoseconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => nanoseconds.call(1), "1");
|
||||
assert.throws(TypeError, () => nanoseconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => nanoseconds.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => nanoseconds.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.negated
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const negated = Temporal.Duration.prototype.negated;
|
||||
|
||||
assert.sameValue(typeof negated, "function");
|
||||
|
||||
assert.throws(TypeError, () => negated.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => negated.call(null), "null");
|
||||
assert.throws(TypeError, () => negated.call(true), "true");
|
||||
assert.throws(TypeError, () => negated.call(""), "empty string");
|
||||
assert.throws(TypeError, () => negated.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => negated.call(1), "1");
|
||||
assert.throws(TypeError, () => negated.call({}), "plain object");
|
||||
assert.throws(TypeError, () => negated.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => negated.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.round
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const round = Temporal.Duration.prototype.round;
|
||||
|
||||
assert.sameValue(typeof round, "function");
|
||||
|
||||
assert.throws(TypeError, () => round.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => round.call(null), "null");
|
||||
assert.throws(TypeError, () => round.call(true), "true");
|
||||
assert.throws(TypeError, () => round.call(""), "empty string");
|
||||
assert.throws(TypeError, () => round.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => round.call(1), "1");
|
||||
assert.throws(TypeError, () => round.call({}), "plain object");
|
||||
assert.throws(TypeError, () => round.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => round.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.seconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const seconds = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "seconds").get;
|
||||
|
||||
assert.sameValue(typeof seconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => seconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => seconds.call(null), "null");
|
||||
assert.throws(TypeError, () => seconds.call(true), "true");
|
||||
assert.throws(TypeError, () => seconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => seconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => seconds.call(1), "1");
|
||||
assert.throws(TypeError, () => seconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => seconds.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => seconds.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.sign
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const sign = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "sign").get;
|
||||
|
||||
assert.sameValue(typeof sign, "function");
|
||||
|
||||
assert.throws(TypeError, () => sign.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => sign.call(null), "null");
|
||||
assert.throws(TypeError, () => sign.call(true), "true");
|
||||
assert.throws(TypeError, () => sign.call(""), "empty string");
|
||||
assert.throws(TypeError, () => sign.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => sign.call(1), "1");
|
||||
assert.throws(TypeError, () => sign.call({}), "plain object");
|
||||
assert.throws(TypeError, () => sign.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => sign.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.subtract
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const subtract = Temporal.Duration.prototype.subtract;
|
||||
|
||||
assert.sameValue(typeof subtract, "function");
|
||||
|
||||
assert.throws(TypeError, () => subtract.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => subtract.call(null), "null");
|
||||
assert.throws(TypeError, () => subtract.call(true), "true");
|
||||
assert.throws(TypeError, () => subtract.call(""), "empty string");
|
||||
assert.throws(TypeError, () => subtract.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => subtract.call(1), "1");
|
||||
assert.throws(TypeError, () => subtract.call({}), "plain object");
|
||||
assert.throws(TypeError, () => subtract.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => subtract.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.tojson
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toJSON = Temporal.Duration.prototype.toJSON;
|
||||
|
||||
assert.sameValue(typeof toJSON, "function");
|
||||
|
||||
assert.throws(TypeError, () => toJSON.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toJSON.call(null), "null");
|
||||
assert.throws(TypeError, () => toJSON.call(true), "true");
|
||||
assert.throws(TypeError, () => toJSON.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toJSON.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toJSON.call(1), "1");
|
||||
assert.throws(TypeError, () => toJSON.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toJSON.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => toJSON.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.tolocalestring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toLocaleString = Temporal.Duration.prototype.toLocaleString;
|
||||
|
||||
assert.sameValue(typeof toLocaleString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toLocaleString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toLocaleString.call(null), "null");
|
||||
assert.throws(TypeError, () => toLocaleString.call(true), "true");
|
||||
assert.throws(TypeError, () => toLocaleString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toLocaleString.call(1), "1");
|
||||
assert.throws(TypeError, () => toLocaleString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.tostring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toString = Temporal.Duration.prototype.toString;
|
||||
|
||||
assert.sameValue(typeof toString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toString.call(null), "null");
|
||||
assert.throws(TypeError, () => toString.call(true), "true");
|
||||
assert.throws(TypeError, () => toString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toString.call(1), "1");
|
||||
assert.throws(TypeError, () => toString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.total
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const total = Temporal.Duration.prototype.total;
|
||||
|
||||
assert.sameValue(typeof total, "function");
|
||||
|
||||
assert.throws(TypeError, () => total.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => total.call(null), "null");
|
||||
assert.throws(TypeError, () => total.call(true), "true");
|
||||
assert.throws(TypeError, () => total.call(""), "empty string");
|
||||
assert.throws(TypeError, () => total.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => total.call(1), "1");
|
||||
assert.throws(TypeError, () => total.call({}), "plain object");
|
||||
assert.throws(TypeError, () => total.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => total.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.valueof
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const valueOf = Temporal.Duration.prototype.valueOf;
|
||||
|
||||
assert.sameValue(typeof valueOf, "function");
|
||||
|
||||
assert.throws(TypeError, () => valueOf.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => valueOf.call(null), "null");
|
||||
assert.throws(TypeError, () => valueOf.call(true), "true");
|
||||
assert.throws(TypeError, () => valueOf.call(""), "empty string");
|
||||
assert.throws(TypeError, () => valueOf.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => valueOf.call(1), "1");
|
||||
assert.throws(TypeError, () => valueOf.call({}), "plain object");
|
||||
assert.throws(TypeError, () => valueOf.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => valueOf.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.weeks
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const weeks = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "weeks").get;
|
||||
|
||||
assert.sameValue(typeof weeks, "function");
|
||||
|
||||
assert.throws(TypeError, () => weeks.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => weeks.call(null), "null");
|
||||
assert.throws(TypeError, () => weeks.call(true), "true");
|
||||
assert.throws(TypeError, () => weeks.call(""), "empty string");
|
||||
assert.throws(TypeError, () => weeks.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => weeks.call(1), "1");
|
||||
assert.throws(TypeError, () => weeks.call({}), "plain object");
|
||||
assert.throws(TypeError, () => weeks.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => weeks.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.duration.prototype.with
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const with_ = Temporal.Duration.prototype.with;
|
||||
|
||||
assert.sameValue(typeof with_, "function");
|
||||
|
||||
assert.throws(TypeError, () => with_.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => with_.call(null), "null");
|
||||
assert.throws(TypeError, () => with_.call(true), "true");
|
||||
assert.throws(TypeError, () => with_.call(""), "empty string");
|
||||
assert.throws(TypeError, () => with_.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => with_.call(1), "1");
|
||||
assert.throws(TypeError, () => with_.call({}), "plain object");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.duration.prototype.years
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const years = Object.getOwnPropertyDescriptor(Temporal.Duration.prototype, "years").get;
|
||||
|
||||
assert.sameValue(typeof years, "function");
|
||||
|
||||
assert.throws(TypeError, () => years.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => years.call(null), "null");
|
||||
assert.throws(TypeError, () => years.call(true), "true");
|
||||
assert.throws(TypeError, () => years.call(""), "empty string");
|
||||
assert.throws(TypeError, () => years.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => years.call(1), "1");
|
||||
assert.throws(TypeError, () => years.call({}), "plain object");
|
||||
assert.throws(TypeError, () => years.call(Temporal.Duration), "Temporal.Duration");
|
||||
assert.throws(TypeError, () => years.call(Temporal.Duration.prototype), "Temporal.Duration.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.add
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const add = Temporal.Instant.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.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => add.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.instant.prototype.epochmicroseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const epochMicroseconds = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochMicroseconds").get;
|
||||
|
||||
assert.sameValue(typeof epochMicroseconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(null), "null");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(true), "true");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(1), "1");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => epochMicroseconds.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.instant.prototype.epochmilliseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const epochMilliseconds = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochMilliseconds").get;
|
||||
|
||||
assert.sameValue(typeof epochMilliseconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(null), "null");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(true), "true");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(1), "1");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => epochMilliseconds.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.instant.prototype.epochnanoseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const epochNanoseconds = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochNanoseconds").get;
|
||||
|
||||
assert.sameValue(typeof epochNanoseconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(null), "null");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(true), "true");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(1), "1");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => epochNanoseconds.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.instant.prototype.epochseconds
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const epochSeconds = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochSeconds").get;
|
||||
|
||||
assert.sameValue(typeof epochSeconds, "function");
|
||||
|
||||
assert.throws(TypeError, () => epochSeconds.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => epochSeconds.call(null), "null");
|
||||
assert.throws(TypeError, () => epochSeconds.call(true), "true");
|
||||
assert.throws(TypeError, () => epochSeconds.call(""), "empty string");
|
||||
assert.throws(TypeError, () => epochSeconds.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => epochSeconds.call(1), "1");
|
||||
assert.throws(TypeError, () => epochSeconds.call({}), "plain object");
|
||||
assert.throws(TypeError, () => epochSeconds.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => epochSeconds.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.equals
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const equals = Temporal.Instant.prototype.equals;
|
||||
|
||||
assert.sameValue(typeof equals, "function");
|
||||
|
||||
assert.throws(TypeError, () => equals.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => equals.call(null), "null");
|
||||
assert.throws(TypeError, () => equals.call(true), "true");
|
||||
assert.throws(TypeError, () => equals.call(""), "empty string");
|
||||
assert.throws(TypeError, () => equals.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => equals.call(1), "1");
|
||||
assert.throws(TypeError, () => equals.call({}), "plain object");
|
||||
assert.throws(TypeError, () => equals.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => equals.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.instant.prototype.round
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const round = Temporal.Instant.prototype.round;
|
||||
|
||||
assert.sameValue(typeof round, "function");
|
||||
|
||||
assert.throws(TypeError, () => round.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => round.call(null), "null");
|
||||
assert.throws(TypeError, () => round.call(true), "true");
|
||||
assert.throws(TypeError, () => round.call(""), "empty string");
|
||||
assert.throws(TypeError, () => round.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => round.call(1), "1");
|
||||
assert.throws(TypeError, () => round.call({}), "plain object");
|
||||
assert.throws(TypeError, () => round.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => round.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.since
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const since = Temporal.Instant.prototype.since;
|
||||
|
||||
assert.sameValue(typeof since, "function");
|
||||
|
||||
assert.throws(TypeError, () => since.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => since.call(null), "null");
|
||||
assert.throws(TypeError, () => since.call(true), "true");
|
||||
assert.throws(TypeError, () => since.call(""), "empty string");
|
||||
assert.throws(TypeError, () => since.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => since.call(1), "1");
|
||||
assert.throws(TypeError, () => since.call({}), "plain object");
|
||||
assert.throws(TypeError, () => since.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => since.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.subtract
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const subtract = Temporal.Instant.prototype.subtract;
|
||||
|
||||
assert.sameValue(typeof subtract, "function");
|
||||
|
||||
assert.throws(TypeError, () => subtract.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => subtract.call(null), "null");
|
||||
assert.throws(TypeError, () => subtract.call(true), "true");
|
||||
assert.throws(TypeError, () => subtract.call(""), "empty string");
|
||||
assert.throws(TypeError, () => subtract.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => subtract.call(1), "1");
|
||||
assert.throws(TypeError, () => subtract.call({}), "plain object");
|
||||
assert.throws(TypeError, () => subtract.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => subtract.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.tojson
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toJSON = Temporal.Instant.prototype.toJSON;
|
||||
|
||||
assert.sameValue(typeof toJSON, "function");
|
||||
|
||||
assert.throws(TypeError, () => toJSON.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toJSON.call(null), "null");
|
||||
assert.throws(TypeError, () => toJSON.call(true), "true");
|
||||
assert.throws(TypeError, () => toJSON.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toJSON.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toJSON.call(1), "1");
|
||||
assert.throws(TypeError, () => toJSON.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toJSON.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => toJSON.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.tolocalestring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toLocaleString = Temporal.Instant.prototype.toLocaleString;
|
||||
|
||||
assert.sameValue(typeof toLocaleString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toLocaleString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toLocaleString.call(null), "null");
|
||||
assert.throws(TypeError, () => toLocaleString.call(true), "true");
|
||||
assert.throws(TypeError, () => toLocaleString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toLocaleString.call(1), "1");
|
||||
assert.throws(TypeError, () => toLocaleString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.tostring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toString = Temporal.Instant.prototype.toString;
|
||||
|
||||
assert.sameValue(typeof toString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toString.call(null), "null");
|
||||
assert.throws(TypeError, () => toString.call(true), "true");
|
||||
assert.throws(TypeError, () => toString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toString.call(1), "1");
|
||||
assert.throws(TypeError, () => toString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.tozoneddatetime
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toZonedDateTime = Temporal.Instant.prototype.toZonedDateTime;
|
||||
|
||||
assert.sameValue(typeof toZonedDateTime, "function");
|
||||
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(null), "null");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(true), "true");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(1), "1");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.instant.prototype.tozoneddatetimeiso
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toZonedDateTimeISO = Temporal.Instant.prototype.toZonedDateTimeISO;
|
||||
|
||||
assert.sameValue(typeof toZonedDateTimeISO, "function");
|
||||
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(null), "null");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(true), "true");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(1), "1");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => toZonedDateTimeISO.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.instant.prototype.until
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const until = Temporal.Instant.prototype.until;
|
||||
|
||||
assert.sameValue(typeof until, "function");
|
||||
|
||||
assert.throws(TypeError, () => until.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => until.call(null), "null");
|
||||
assert.throws(TypeError, () => until.call(true), "true");
|
||||
assert.throws(TypeError, () => until.call(""), "empty string");
|
||||
assert.throws(TypeError, () => until.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => until.call(1), "1");
|
||||
assert.throws(TypeError, () => until.call({}), "plain object");
|
||||
assert.throws(TypeError, () => until.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => until.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.instant.prototype.valueof
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const valueOf = Temporal.Instant.prototype.valueOf;
|
||||
|
||||
assert.sameValue(typeof valueOf, "function");
|
||||
|
||||
assert.throws(TypeError, () => valueOf.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => valueOf.call(null), "null");
|
||||
assert.throws(TypeError, () => valueOf.call(true), "true");
|
||||
assert.throws(TypeError, () => valueOf.call(""), "empty string");
|
||||
assert.throws(TypeError, () => valueOf.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => valueOf.call(1), "1");
|
||||
assert.throws(TypeError, () => valueOf.call({}), "plain object");
|
||||
assert.throws(TypeError, () => valueOf.call(Temporal.Instant), "Temporal.Instant");
|
||||
assert.throws(TypeError, () => valueOf.call(Temporal.Instant.prototype), "Temporal.Instant.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 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: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const add = Temporal.PlainDate.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.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => add.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.calendar
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const calendar = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "calendar").get;
|
||||
|
||||
assert.sameValue(typeof calendar, "function");
|
||||
|
||||
assert.throws(TypeError, () => calendar.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => calendar.call(null), "null");
|
||||
assert.throws(TypeError, () => calendar.call(true), "true");
|
||||
assert.throws(TypeError, () => calendar.call(""), "empty string");
|
||||
assert.throws(TypeError, () => calendar.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => calendar.call(1), "1");
|
||||
assert.throws(TypeError, () => calendar.call({}), "plain object");
|
||||
assert.throws(TypeError, () => calendar.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => calendar.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.day
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const day = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "day").get;
|
||||
|
||||
assert.sameValue(typeof day, "function");
|
||||
|
||||
assert.throws(TypeError, () => day.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => day.call(null), "null");
|
||||
assert.throws(TypeError, () => day.call(true), "true");
|
||||
assert.throws(TypeError, () => day.call(""), "empty string");
|
||||
assert.throws(TypeError, () => day.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => day.call(1), "1");
|
||||
assert.throws(TypeError, () => day.call({}), "plain object");
|
||||
assert.throws(TypeError, () => day.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => day.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.dayofweek
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dayOfWeek = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "dayOfWeek").get;
|
||||
|
||||
assert.sameValue(typeof dayOfWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.dayofyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dayOfYear = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "dayOfYear").get;
|
||||
|
||||
assert.sameValue(typeof dayOfYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfYear.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfYear.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfYear.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.daysinmonth
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInMonth = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "daysInMonth").get;
|
||||
|
||||
assert.sameValue(typeof daysInMonth, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInMonth.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInMonth.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInMonth.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInMonth.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInMonth.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInMonth.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.daysinweek
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInWeek = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "daysInWeek").get;
|
||||
|
||||
assert.sameValue(typeof daysInWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.daysinyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInYear = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "daysInYear").get;
|
||||
|
||||
assert.sameValue(typeof daysInYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInYear.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInYear.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInYear.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.equals
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const equals = Temporal.PlainDate.prototype.equals;
|
||||
|
||||
assert.sameValue(typeof equals, "function");
|
||||
|
||||
assert.throws(TypeError, () => equals.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => equals.call(null), "null");
|
||||
assert.throws(TypeError, () => equals.call(true), "true");
|
||||
assert.throws(TypeError, () => equals.call(""), "empty string");
|
||||
assert.throws(TypeError, () => equals.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => equals.call(1), "1");
|
||||
assert.throws(TypeError, () => equals.call({}), "plain object");
|
||||
assert.throws(TypeError, () => equals.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => equals.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.era
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const era = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "era").get;
|
||||
|
||||
assert.sameValue(typeof era, "function");
|
||||
|
||||
assert.throws(TypeError, () => era.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => era.call(null), "null");
|
||||
assert.throws(TypeError, () => era.call(true), "true");
|
||||
assert.throws(TypeError, () => era.call(""), "empty string");
|
||||
assert.throws(TypeError, () => era.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => era.call(1), "1");
|
||||
assert.throws(TypeError, () => era.call({}), "plain object");
|
||||
assert.throws(TypeError, () => era.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => era.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.erayear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const eraYear = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "eraYear").get;
|
||||
|
||||
assert.sameValue(typeof eraYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => eraYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => eraYear.call(null), "null");
|
||||
assert.throws(TypeError, () => eraYear.call(true), "true");
|
||||
assert.throws(TypeError, () => eraYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => eraYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => eraYear.call(1), "1");
|
||||
assert.throws(TypeError, () => eraYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => eraYear.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => eraYear.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.getisofields
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const getISOFields = Temporal.PlainDate.prototype.getISOFields;
|
||||
|
||||
assert.sameValue(typeof getISOFields, "function");
|
||||
|
||||
assert.throws(TypeError, () => getISOFields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => getISOFields.call(null), "null");
|
||||
assert.throws(TypeError, () => getISOFields.call(true), "true");
|
||||
assert.throws(TypeError, () => getISOFields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => getISOFields.call(1), "1");
|
||||
assert.throws(TypeError, () => getISOFields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.inleapyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const inLeapYear = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "inLeapYear").get;
|
||||
|
||||
assert.sameValue(typeof inLeapYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => inLeapYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => inLeapYear.call(null), "null");
|
||||
assert.throws(TypeError, () => inLeapYear.call(true), "true");
|
||||
assert.throws(TypeError, () => inLeapYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => inLeapYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => inLeapYear.call(1), "1");
|
||||
assert.throws(TypeError, () => inLeapYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => inLeapYear.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => inLeapYear.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.month
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const month = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "month").get;
|
||||
|
||||
assert.sameValue(typeof month, "function");
|
||||
|
||||
assert.throws(TypeError, () => month.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => month.call(null), "null");
|
||||
assert.throws(TypeError, () => month.call(true), "true");
|
||||
assert.throws(TypeError, () => month.call(""), "empty string");
|
||||
assert.throws(TypeError, () => month.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => month.call(1), "1");
|
||||
assert.throws(TypeError, () => month.call({}), "plain object");
|
||||
assert.throws(TypeError, () => month.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => month.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.monthcode
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const monthCode = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "monthCode").get;
|
||||
|
||||
assert.sameValue(typeof monthCode, "function");
|
||||
|
||||
assert.throws(TypeError, () => monthCode.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => monthCode.call(null), "null");
|
||||
assert.throws(TypeError, () => monthCode.call(true), "true");
|
||||
assert.throws(TypeError, () => monthCode.call(""), "empty string");
|
||||
assert.throws(TypeError, () => monthCode.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => monthCode.call(1), "1");
|
||||
assert.throws(TypeError, () => monthCode.call({}), "plain object");
|
||||
assert.throws(TypeError, () => monthCode.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => monthCode.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.monthsinyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const monthsInYear = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "monthsInYear").get;
|
||||
|
||||
assert.sameValue(typeof monthsInYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => monthsInYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => monthsInYear.call(null), "null");
|
||||
assert.throws(TypeError, () => monthsInYear.call(true), "true");
|
||||
assert.throws(TypeError, () => monthsInYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => monthsInYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => monthsInYear.call(1), "1");
|
||||
assert.throws(TypeError, () => monthsInYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => monthsInYear.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => monthsInYear.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.since
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const since = Temporal.PlainDate.prototype.since;
|
||||
|
||||
assert.sameValue(typeof since, "function");
|
||||
|
||||
assert.throws(TypeError, () => since.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => since.call(null), "null");
|
||||
assert.throws(TypeError, () => since.call(true), "true");
|
||||
assert.throws(TypeError, () => since.call(""), "empty string");
|
||||
assert.throws(TypeError, () => since.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => since.call(1), "1");
|
||||
assert.throws(TypeError, () => since.call({}), "plain object");
|
||||
assert.throws(TypeError, () => since.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => since.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.subtract
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const subtract = Temporal.PlainDate.prototype.subtract;
|
||||
|
||||
assert.sameValue(typeof subtract, "function");
|
||||
|
||||
assert.throws(TypeError, () => subtract.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => subtract.call(null), "null");
|
||||
assert.throws(TypeError, () => subtract.call(true), "true");
|
||||
assert.throws(TypeError, () => subtract.call(""), "empty string");
|
||||
assert.throws(TypeError, () => subtract.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => subtract.call(1), "1");
|
||||
assert.throws(TypeError, () => subtract.call({}), "plain object");
|
||||
assert.throws(TypeError, () => subtract.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => subtract.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.tojson
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toJSON = Temporal.PlainDate.prototype.toJSON;
|
||||
|
||||
assert.sameValue(typeof toJSON, "function");
|
||||
|
||||
assert.throws(TypeError, () => toJSON.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toJSON.call(null), "null");
|
||||
assert.throws(TypeError, () => toJSON.call(true), "true");
|
||||
assert.throws(TypeError, () => toJSON.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toJSON.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toJSON.call(1), "1");
|
||||
assert.throws(TypeError, () => toJSON.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toJSON.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toJSON.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.tolocalestring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toLocaleString = Temporal.PlainDate.prototype.toLocaleString;
|
||||
|
||||
assert.sameValue(typeof toLocaleString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toLocaleString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toLocaleString.call(null), "null");
|
||||
assert.throws(TypeError, () => toLocaleString.call(true), "true");
|
||||
assert.throws(TypeError, () => toLocaleString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toLocaleString.call(1), "1");
|
||||
assert.throws(TypeError, () => toLocaleString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toLocaleString.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.toplaindatetime
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toPlainDateTime = Temporal.PlainDate.prototype.toPlainDateTime;
|
||||
|
||||
assert.sameValue(typeof toPlainDateTime, "function");
|
||||
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(null), "null");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(true), "true");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(1), "1");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toPlainDateTime.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.toplainmonthday
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toPlainMonthDay = Temporal.PlainDate.prototype.toPlainMonthDay;
|
||||
|
||||
assert.sameValue(typeof toPlainMonthDay, "function");
|
||||
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(null), "null");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(true), "true");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(1), "1");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toPlainMonthDay.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.toplainyearmonth
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toPlainYearMonth = Temporal.PlainDate.prototype.toPlainYearMonth;
|
||||
|
||||
assert.sameValue(typeof toPlainYearMonth, "function");
|
||||
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(null), "null");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(true), "true");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(1), "1");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toPlainYearMonth.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.tostring
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toString = Temporal.PlainDate.prototype.toString;
|
||||
|
||||
assert.sameValue(typeof toString, "function");
|
||||
|
||||
assert.throws(TypeError, () => toString.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toString.call(null), "null");
|
||||
assert.throws(TypeError, () => toString.call(true), "true");
|
||||
assert.throws(TypeError, () => toString.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toString.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toString.call(1), "1");
|
||||
assert.throws(TypeError, () => toString.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toString.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.tozoneddatetime
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const toZonedDateTime = Temporal.PlainDate.prototype.toZonedDateTime;
|
||||
|
||||
assert.sameValue(typeof toZonedDateTime, "function");
|
||||
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(null), "null");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(true), "true");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(1), "1");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.until
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const until = Temporal.PlainDate.prototype.until;
|
||||
|
||||
assert.sameValue(typeof until, "function");
|
||||
|
||||
assert.throws(TypeError, () => until.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => until.call(null), "null");
|
||||
assert.throws(TypeError, () => until.call(true), "true");
|
||||
assert.throws(TypeError, () => until.call(""), "empty string");
|
||||
assert.throws(TypeError, () => until.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => until.call(1), "1");
|
||||
assert.throws(TypeError, () => until.call({}), "plain object");
|
||||
assert.throws(TypeError, () => until.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => until.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.valueof
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const valueOf = Temporal.PlainDate.prototype.valueOf;
|
||||
|
||||
assert.sameValue(typeof valueOf, "function");
|
||||
|
||||
assert.throws(TypeError, () => valueOf.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => valueOf.call(null), "null");
|
||||
assert.throws(TypeError, () => valueOf.call(true), "true");
|
||||
assert.throws(TypeError, () => valueOf.call(""), "empty string");
|
||||
assert.throws(TypeError, () => valueOf.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => valueOf.call(1), "1");
|
||||
assert.throws(TypeError, () => valueOf.call({}), "plain object");
|
||||
assert.throws(TypeError, () => valueOf.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => valueOf.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.weekofyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const weekOfYear = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "weekOfYear").get;
|
||||
|
||||
assert.sameValue(typeof weekOfYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => weekOfYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => weekOfYear.call(null), "null");
|
||||
assert.throws(TypeError, () => weekOfYear.call(true), "true");
|
||||
assert.throws(TypeError, () => weekOfYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => weekOfYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => weekOfYear.call(1), "1");
|
||||
assert.throws(TypeError, () => weekOfYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => weekOfYear.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => weekOfYear.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.with
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const with_ = Temporal.PlainDate.prototype.with;
|
||||
|
||||
assert.sameValue(typeof with_, "function");
|
||||
|
||||
assert.throws(TypeError, () => with_.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => with_.call(null), "null");
|
||||
assert.throws(TypeError, () => with_.call(true), "true");
|
||||
assert.throws(TypeError, () => with_.call(""), "empty string");
|
||||
assert.throws(TypeError, () => with_.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => with_.call(1), "1");
|
||||
assert.throws(TypeError, () => with_.call({}), "plain object");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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.withcalendar
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const withCalendar = Temporal.PlainDate.prototype.withCalendar;
|
||||
|
||||
assert.sameValue(typeof withCalendar, "function");
|
||||
|
||||
assert.throws(TypeError, () => withCalendar.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => withCalendar.call(null), "null");
|
||||
assert.throws(TypeError, () => withCalendar.call(true), "true");
|
||||
assert.throws(TypeError, () => withCalendar.call(""), "empty string");
|
||||
assert.throws(TypeError, () => withCalendar.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => withCalendar.call(1), "1");
|
||||
assert.throws(TypeError, () => withCalendar.call({}), "plain object");
|
||||
assert.throws(TypeError, () => withCalendar.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => withCalendar.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindate.prototype.year
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const year = Object.getOwnPropertyDescriptor(Temporal.PlainDate.prototype, "year").get;
|
||||
|
||||
assert.sameValue(typeof year, "function");
|
||||
|
||||
assert.throws(TypeError, () => year.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => year.call(null), "null");
|
||||
assert.throws(TypeError, () => year.call(true), "true");
|
||||
assert.throws(TypeError, () => year.call(""), "empty string");
|
||||
assert.throws(TypeError, () => year.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => year.call(1), "1");
|
||||
assert.throws(TypeError, () => year.call({}), "plain object");
|
||||
assert.throws(TypeError, () => year.call(Temporal.PlainDate), "Temporal.PlainDate");
|
||||
assert.throws(TypeError, () => year.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// 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");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.calendar
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const calendar = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "calendar").get;
|
||||
|
||||
assert.sameValue(typeof calendar, "function");
|
||||
|
||||
assert.throws(TypeError, () => calendar.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => calendar.call(null), "null");
|
||||
assert.throws(TypeError, () => calendar.call(true), "true");
|
||||
assert.throws(TypeError, () => calendar.call(""), "empty string");
|
||||
assert.throws(TypeError, () => calendar.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => calendar.call(1), "1");
|
||||
assert.throws(TypeError, () => calendar.call({}), "plain object");
|
||||
assert.throws(TypeError, () => calendar.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => calendar.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.day
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const day = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "day").get;
|
||||
|
||||
assert.sameValue(typeof day, "function");
|
||||
|
||||
assert.throws(TypeError, () => day.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => day.call(null), "null");
|
||||
assert.throws(TypeError, () => day.call(true), "true");
|
||||
assert.throws(TypeError, () => day.call(""), "empty string");
|
||||
assert.throws(TypeError, () => day.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => day.call(1), "1");
|
||||
assert.throws(TypeError, () => day.call({}), "plain object");
|
||||
assert.throws(TypeError, () => day.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => day.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.dayofweek
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dayOfWeek = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "dayOfWeek").get;
|
||||
|
||||
assert.sameValue(typeof dayOfWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.dayofyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const dayOfYear = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "dayOfYear").get;
|
||||
|
||||
assert.sameValue(typeof dayOfYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfYear.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfYear.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfYear.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.daysinmonth
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInMonth = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "daysInMonth").get;
|
||||
|
||||
assert.sameValue(typeof daysInMonth, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInMonth.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInMonth.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInMonth.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInMonth.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInMonth.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInMonth.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.daysinweek
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInWeek = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "daysInWeek").get;
|
||||
|
||||
assert.sameValue(typeof daysInWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-get-temporal.plaindatetime.prototype.daysinyear
|
||||
description: Throw a TypeError if the receiver is invalid
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
const daysInYear = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "daysInYear").get;
|
||||
|
||||
assert.sameValue(typeof daysInYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInYear.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInYear.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInYear.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.PlainDateTime), "Temporal.PlainDateTime");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype");
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue