diff --git a/test/built-ins/Temporal/Calendar/prototype/dateAdd/branding.js b/test/built-ins/Temporal/Calendar/prototype/dateAdd/branding.js new file mode 100644 index 0000000000..29972471fe --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dateAdd/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dateFromFields/branding.js b/test/built-ins/Temporal/Calendar/prototype/dateFromFields/branding.js new file mode 100644 index 0000000000..bd5250194a --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dateFromFields/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dateUntil/branding.js b/test/built-ins/Temporal/Calendar/prototype/dateUntil/branding.js new file mode 100644 index 0000000000..b6da8916a3 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dateUntil/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/branding.js b/test/built-ins/Temporal/Calendar/prototype/day/branding.js new file mode 100644 index 0000000000..eafea5fcfe --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/branding.js b/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/branding.js new file mode 100644 index 0000000000..bbcfc7fb25 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dayOfYear/branding.js b/test/built-ins/Temporal/Calendar/prototype/dayOfYear/branding.js new file mode 100644 index 0000000000..b60323ae65 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dayOfYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInMonth/branding.js b/test/built-ins/Temporal/Calendar/prototype/daysInMonth/branding.js new file mode 100644 index 0000000000..84f76e7aaa --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/daysInMonth/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInWeek/branding.js b/test/built-ins/Temporal/Calendar/prototype/daysInWeek/branding.js new file mode 100644 index 0000000000..1d1c859bb5 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/daysInWeek/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInYear/branding.js b/test/built-ins/Temporal/Calendar/prototype/daysInYear/branding.js new file mode 100644 index 0000000000..e7bf10dbf6 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/daysInYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/era/branding.js b/test/built-ins/Temporal/Calendar/prototype/era/branding.js new file mode 100644 index 0000000000..b8b5ed214c --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/era/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/eraYear/branding.js b/test/built-ins/Temporal/Calendar/prototype/eraYear/branding.js new file mode 100644 index 0000000000..8bd9c313ff --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/eraYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/fields/branding.js b/test/built-ins/Temporal/Calendar/prototype/fields/branding.js new file mode 100644 index 0000000000..bd62883331 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/fields/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/inLeapYear/branding.js b/test/built-ins/Temporal/Calendar/prototype/inLeapYear/branding.js new file mode 100644 index 0000000000..8b3e5de8a2 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/inLeapYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/mergeFields/branding.js b/test/built-ins/Temporal/Calendar/prototype/mergeFields/branding.js new file mode 100644 index 0000000000..0ef2b3f84d --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/mergeFields/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/branding.js b/test/built-ins/Temporal/Calendar/prototype/month/branding.js new file mode 100644 index 0000000000..612b047b14 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/branding.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/branding.js new file mode 100644 index 0000000000..210291345d --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthDayFromFields/branding.js b/test/built-ins/Temporal/Calendar/prototype/monthDayFromFields/branding.js new file mode 100644 index 0000000000..63691c7c4b --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthDayFromFields/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthsInYear/branding.js b/test/built-ins/Temporal/Calendar/prototype/monthsInYear/branding.js new file mode 100644 index 0000000000..e86c5f50e2 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthsInYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/toString/branding.js b/test/built-ins/Temporal/Calendar/prototype/toString/branding.js new file mode 100644 index 0000000000..21449e5411 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/toString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/weekOfYear/branding.js b/test/built-ins/Temporal/Calendar/prototype/weekOfYear/branding.js new file mode 100644 index 0000000000..82f80e27c7 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/weekOfYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/branding.js b/test/built-ins/Temporal/Calendar/prototype/year/branding.js new file mode 100644 index 0000000000..17e9b710ed --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Calendar/prototype/yearMonthFromFields/branding.js b/test/built-ins/Temporal/Calendar/prototype/yearMonthFromFields/branding.js new file mode 100644 index 0000000000..0839394ca9 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/yearMonthFromFields/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/abs/branding.js b/test/built-ins/Temporal/Duration/prototype/abs/branding.js new file mode 100644 index 0000000000..cb45cce69d --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/abs/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/add/branding.js b/test/built-ins/Temporal/Duration/prototype/add/branding.js new file mode 100644 index 0000000000..e311bd44f8 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/add/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/blank/branding.js b/test/built-ins/Temporal/Duration/prototype/blank/branding.js new file mode 100644 index 0000000000..fbfdc4a10c --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/blank/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/days/branding.js b/test/built-ins/Temporal/Duration/prototype/days/branding.js new file mode 100644 index 0000000000..8a55f399a7 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/days/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/hours/branding.js b/test/built-ins/Temporal/Duration/prototype/hours/branding.js new file mode 100644 index 0000000000..da72621a1a --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/hours/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/microseconds/branding.js b/test/built-ins/Temporal/Duration/prototype/microseconds/branding.js new file mode 100644 index 0000000000..813670405e --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/microseconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/milliseconds/branding.js b/test/built-ins/Temporal/Duration/prototype/milliseconds/branding.js new file mode 100644 index 0000000000..28c0242175 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/milliseconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/minutes/branding.js b/test/built-ins/Temporal/Duration/prototype/minutes/branding.js new file mode 100644 index 0000000000..fffcd387e9 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/minutes/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/months/branding.js b/test/built-ins/Temporal/Duration/prototype/months/branding.js new file mode 100644 index 0000000000..cf6030edca --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/months/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/nanoseconds/branding.js b/test/built-ins/Temporal/Duration/prototype/nanoseconds/branding.js new file mode 100644 index 0000000000..15b684b183 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/nanoseconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/negated/branding.js b/test/built-ins/Temporal/Duration/prototype/negated/branding.js new file mode 100644 index 0000000000..612dcafb9b --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/negated/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/round/branding.js b/test/built-ins/Temporal/Duration/prototype/round/branding.js new file mode 100644 index 0000000000..503b77f9bf --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/round/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/seconds/branding.js b/test/built-ins/Temporal/Duration/prototype/seconds/branding.js new file mode 100644 index 0000000000..4cd3ba7827 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/seconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/sign/branding.js b/test/built-ins/Temporal/Duration/prototype/sign/branding.js new file mode 100644 index 0000000000..9da05c7779 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/sign/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/subtract/branding.js b/test/built-ins/Temporal/Duration/prototype/subtract/branding.js new file mode 100644 index 0000000000..e9264d8e6f --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/subtract/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/toJSON/branding.js b/test/built-ins/Temporal/Duration/prototype/toJSON/branding.js new file mode 100644 index 0000000000..e44c1d5380 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/toJSON/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/Duration/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..5bc550e8e3 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/toLocaleString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/toString/branding.js b/test/built-ins/Temporal/Duration/prototype/toString/branding.js new file mode 100644 index 0000000000..3bd82646b2 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/toString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/total/branding.js b/test/built-ins/Temporal/Duration/prototype/total/branding.js new file mode 100644 index 0000000000..a6841b0bce --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/total/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/valueOf/branding.js b/test/built-ins/Temporal/Duration/prototype/valueOf/branding.js new file mode 100644 index 0000000000..a4146cf9f1 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/valueOf/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/weeks/branding.js b/test/built-ins/Temporal/Duration/prototype/weeks/branding.js new file mode 100644 index 0000000000..42a837aadf --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/weeks/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/with/branding.js b/test/built-ins/Temporal/Duration/prototype/with/branding.js new file mode 100644 index 0000000000..2bc9af85bf --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/with/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Duration/prototype/years/branding.js b/test/built-ins/Temporal/Duration/prototype/years/branding.js new file mode 100644 index 0000000000..2d95a26327 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/years/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/add/branding.js b/test/built-ins/Temporal/Instant/prototype/add/branding.js new file mode 100644 index 0000000000..cb6b1158c6 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/add/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/branding.js b/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/branding.js new file mode 100644 index 0000000000..654833ba08 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochMilliseconds/branding.js b/test/built-ins/Temporal/Instant/prototype/epochMilliseconds/branding.js new file mode 100644 index 0000000000..04188ecd84 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/epochMilliseconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochNanoseconds/branding.js b/test/built-ins/Temporal/Instant/prototype/epochNanoseconds/branding.js new file mode 100644 index 0000000000..44d4989ff9 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/epochNanoseconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochSeconds/branding.js b/test/built-ins/Temporal/Instant/prototype/epochSeconds/branding.js new file mode 100644 index 0000000000..a6c30b798b --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/epochSeconds/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/equals/branding.js b/test/built-ins/Temporal/Instant/prototype/equals/branding.js new file mode 100644 index 0000000000..5aafe306d1 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/equals/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/round/branding.js b/test/built-ins/Temporal/Instant/prototype/round/branding.js new file mode 100644 index 0000000000..116f31b767 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/round/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/since/branding.js b/test/built-ins/Temporal/Instant/prototype/since/branding.js new file mode 100644 index 0000000000..0716c625d0 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/since/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/subtract/branding.js b/test/built-ins/Temporal/Instant/prototype/subtract/branding.js new file mode 100644 index 0000000000..d7c307e3f9 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/subtract/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/toJSON/branding.js b/test/built-ins/Temporal/Instant/prototype/toJSON/branding.js new file mode 100644 index 0000000000..be2d3461e7 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toJSON/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/Instant/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..aa3f053759 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toLocaleString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/toString/branding.js b/test/built-ins/Temporal/Instant/prototype/toString/branding.js new file mode 100644 index 0000000000..55a72d9a49 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/branding.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/branding.js new file mode 100644 index 0000000000..71409a387b --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js new file mode 100644 index 0000000000..091591a1ce --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/until/branding.js b/test/built-ins/Temporal/Instant/prototype/until/branding.js new file mode 100644 index 0000000000..70fb066c5e --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/until/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/valueOf/branding.js b/test/built-ins/Temporal/Instant/prototype/valueOf/branding.js new file mode 100644 index 0000000000..4fc03e390e --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/valueOf/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/add/branding.js b/test/built-ins/Temporal/PlainDate/prototype/add/branding.js new file mode 100644 index 0000000000..b60ec44d51 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/add/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/calendar/branding.js b/test/built-ins/Temporal/PlainDate/prototype/calendar/branding.js new file mode 100644 index 0000000000..fc28805d6a --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/calendar/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/day/branding.js b/test/built-ins/Temporal/PlainDate/prototype/day/branding.js new file mode 100644 index 0000000000..39e71bd0be --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/day/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/dayOfWeek/branding.js b/test/built-ins/Temporal/PlainDate/prototype/dayOfWeek/branding.js new file mode 100644 index 0000000000..f88ab596c6 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/dayOfWeek/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/dayOfYear/branding.js b/test/built-ins/Temporal/PlainDate/prototype/dayOfYear/branding.js new file mode 100644 index 0000000000..5bf0aed3f6 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/dayOfYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/daysInMonth/branding.js b/test/built-ins/Temporal/PlainDate/prototype/daysInMonth/branding.js new file mode 100644 index 0000000000..d4568d927c --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/daysInMonth/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/daysInWeek/branding.js b/test/built-ins/Temporal/PlainDate/prototype/daysInWeek/branding.js new file mode 100644 index 0000000000..873b9c86e9 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/daysInWeek/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/daysInYear/branding.js b/test/built-ins/Temporal/PlainDate/prototype/daysInYear/branding.js new file mode 100644 index 0000000000..7752f95159 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/daysInYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/equals/branding.js b/test/built-ins/Temporal/PlainDate/prototype/equals/branding.js new file mode 100644 index 0000000000..58c78e622f --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/equals/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/era/branding.js b/test/built-ins/Temporal/PlainDate/prototype/era/branding.js new file mode 100644 index 0000000000..c0f33337d3 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/era/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/eraYear/branding.js b/test/built-ins/Temporal/PlainDate/prototype/eraYear/branding.js new file mode 100644 index 0000000000..0b370869c7 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/eraYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/branding.js new file mode 100644 index 0000000000..f24b13c225 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/inLeapYear/branding.js b/test/built-ins/Temporal/PlainDate/prototype/inLeapYear/branding.js new file mode 100644 index 0000000000..88345ea8a1 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/inLeapYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/month/branding.js b/test/built-ins/Temporal/PlainDate/prototype/month/branding.js new file mode 100644 index 0000000000..625e88e93b --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/month/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/monthCode/branding.js b/test/built-ins/Temporal/PlainDate/prototype/monthCode/branding.js new file mode 100644 index 0000000000..225adefef9 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/monthCode/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/monthsInYear/branding.js b/test/built-ins/Temporal/PlainDate/prototype/monthsInYear/branding.js new file mode 100644 index 0000000000..163d5b4581 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/monthsInYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/branding.js b/test/built-ins/Temporal/PlainDate/prototype/since/branding.js new file mode 100644 index 0000000000..7b7ea57483 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/since/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/subtract/branding.js b/test/built-ins/Temporal/PlainDate/prototype/subtract/branding.js new file mode 100644 index 0000000000..fb89bca42b --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/subtract/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toJSON/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toJSON/branding.js new file mode 100644 index 0000000000..c384ffedbe --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toJSON/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..8dc444a6da --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toLocaleString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/branding.js new file mode 100644 index 0000000000..c0e812f89f --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/branding.js new file mode 100644 index 0000000000..3579da2ba7 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/branding.js new file mode 100644 index 0000000000..a3ee6e2f37 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toString/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toString/branding.js new file mode 100644 index 0000000000..30b7ff54c7 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toString/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js new file mode 100644 index 0000000000..7d20da46b1 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/branding.js b/test/built-ins/Temporal/PlainDate/prototype/until/branding.js new file mode 100644 index 0000000000..ebbafe59ca --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/until/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/valueOf/branding.js b/test/built-ins/Temporal/PlainDate/prototype/valueOf/branding.js new file mode 100644 index 0000000000..ac182f3ed9 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/valueOf/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/weekOfYear/branding.js b/test/built-ins/Temporal/PlainDate/prototype/weekOfYear/branding.js new file mode 100644 index 0000000000..6f50e42048 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/weekOfYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/with/branding.js b/test/built-ins/Temporal/PlainDate/prototype/with/branding.js new file mode 100644 index 0000000000..e6210e0c51 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/with/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js new file mode 100644 index 0000000000..97f9b34713 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/year/branding.js b/test/built-ins/Temporal/PlainDate/prototype/year/branding.js new file mode 100644 index 0000000000..ebfeff60a7 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/year/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/add/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/add/branding.js new file mode 100644 index 0000000000..161aa7d25d --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/add/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/calendar/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/calendar/branding.js new file mode 100644 index 0000000000..bd6f81d610 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/calendar/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/day/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/day/branding.js new file mode 100644 index 0000000000..0d11824721 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/day/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/branding.js new file mode 100644 index 0000000000..448bb32163 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/branding.js new file mode 100644 index 0000000000..c087ca74c5 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/daysInMonth/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/daysInMonth/branding.js new file mode 100644 index 0000000000..33581a2336 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/daysInMonth/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/daysInWeek/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/daysInWeek/branding.js new file mode 100644 index 0000000000..1ed028e2d2 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/daysInWeek/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/branding.js new file mode 100644 index 0000000000..3533365549 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/branding.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/equals/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/equals/branding.js new file mode 100644 index 0000000000..3b87c808bc --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/equals/branding.js @@ -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.plaindatetime.prototype.equals +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const equals = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => equals.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/era/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/era/branding.js new file mode 100644 index 0000000000..851522209d --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/era/branding.js @@ -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.era +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const era = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => era.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/eraYear/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/eraYear/branding.js new file mode 100644 index 0000000000..22bf08c798 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/eraYear/branding.js @@ -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.erayear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const eraYear = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => eraYear.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/branding.js new file mode 100644 index 0000000000..d4a26742b3 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/branding.js @@ -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.plaindatetime.prototype.getisofields +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getISOFields = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/hour/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/hour/branding.js new file mode 100644 index 0000000000..099259fca9 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/hour/branding.js @@ -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.hour +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const hour = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "hour").get; + +assert.sameValue(typeof hour, "function"); + +assert.throws(TypeError, () => hour.call(undefined), "undefined"); +assert.throws(TypeError, () => hour.call(null), "null"); +assert.throws(TypeError, () => hour.call(true), "true"); +assert.throws(TypeError, () => hour.call(""), "empty string"); +assert.throws(TypeError, () => hour.call(Symbol()), "symbol"); +assert.throws(TypeError, () => hour.call(1), "1"); +assert.throws(TypeError, () => hour.call({}), "plain object"); +assert.throws(TypeError, () => hour.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => hour.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/branding.js new file mode 100644 index 0000000000..07d7783d37 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/branding.js @@ -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.inleapyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const inLeapYear = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => inLeapYear.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/microsecond/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/microsecond/branding.js new file mode 100644 index 0000000000..260fd9720c --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/microsecond/branding.js @@ -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.microsecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const microsecond = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "microsecond").get; + +assert.sameValue(typeof microsecond, "function"); + +assert.throws(TypeError, () => microsecond.call(undefined), "undefined"); +assert.throws(TypeError, () => microsecond.call(null), "null"); +assert.throws(TypeError, () => microsecond.call(true), "true"); +assert.throws(TypeError, () => microsecond.call(""), "empty string"); +assert.throws(TypeError, () => microsecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => microsecond.call(1), "1"); +assert.throws(TypeError, () => microsecond.call({}), "plain object"); +assert.throws(TypeError, () => microsecond.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => microsecond.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/millisecond/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/millisecond/branding.js new file mode 100644 index 0000000000..564c7090d1 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/millisecond/branding.js @@ -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.millisecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const millisecond = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "millisecond").get; + +assert.sameValue(typeof millisecond, "function"); + +assert.throws(TypeError, () => millisecond.call(undefined), "undefined"); +assert.throws(TypeError, () => millisecond.call(null), "null"); +assert.throws(TypeError, () => millisecond.call(true), "true"); +assert.throws(TypeError, () => millisecond.call(""), "empty string"); +assert.throws(TypeError, () => millisecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => millisecond.call(1), "1"); +assert.throws(TypeError, () => millisecond.call({}), "plain object"); +assert.throws(TypeError, () => millisecond.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => millisecond.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/minute/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/minute/branding.js new file mode 100644 index 0000000000..b3d8636a44 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/minute/branding.js @@ -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.minute +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const minute = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "minute").get; + +assert.sameValue(typeof minute, "function"); + +assert.throws(TypeError, () => minute.call(undefined), "undefined"); +assert.throws(TypeError, () => minute.call(null), "null"); +assert.throws(TypeError, () => minute.call(true), "true"); +assert.throws(TypeError, () => minute.call(""), "empty string"); +assert.throws(TypeError, () => minute.call(Symbol()), "symbol"); +assert.throws(TypeError, () => minute.call(1), "1"); +assert.throws(TypeError, () => minute.call({}), "plain object"); +assert.throws(TypeError, () => minute.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => minute.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/month/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/month/branding.js new file mode 100644 index 0000000000..aa27102e16 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/month/branding.js @@ -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.month +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const month = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => month.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/monthCode/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/monthCode/branding.js new file mode 100644 index 0000000000..ed692d4063 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/monthCode/branding.js @@ -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.monthcode +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthCode = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => monthCode.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/branding.js new file mode 100644 index 0000000000..b855d89621 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/branding.js @@ -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.monthsinyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthsInYear = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => monthsInYear.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/nanosecond/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/nanosecond/branding.js new file mode 100644 index 0000000000..84bd8cb519 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/nanosecond/branding.js @@ -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.nanosecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const nanosecond = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "nanosecond").get; + +assert.sameValue(typeof nanosecond, "function"); + +assert.throws(TypeError, () => nanosecond.call(undefined), "undefined"); +assert.throws(TypeError, () => nanosecond.call(null), "null"); +assert.throws(TypeError, () => nanosecond.call(true), "true"); +assert.throws(TypeError, () => nanosecond.call(""), "empty string"); +assert.throws(TypeError, () => nanosecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => nanosecond.call(1), "1"); +assert.throws(TypeError, () => nanosecond.call({}), "plain object"); +assert.throws(TypeError, () => nanosecond.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => nanosecond.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/round/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/round/branding.js new file mode 100644 index 0000000000..9efbaff9c4 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/round/branding.js @@ -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.round +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const round = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => round.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/second/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/second/branding.js new file mode 100644 index 0000000000..4715b18b48 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/second/branding.js @@ -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.second +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const second = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.prototype, "second").get; + +assert.sameValue(typeof second, "function"); + +assert.throws(TypeError, () => second.call(undefined), "undefined"); +assert.throws(TypeError, () => second.call(null), "null"); +assert.throws(TypeError, () => second.call(true), "true"); +assert.throws(TypeError, () => second.call(""), "empty string"); +assert.throws(TypeError, () => second.call(Symbol()), "symbol"); +assert.throws(TypeError, () => second.call(1), "1"); +assert.throws(TypeError, () => second.call({}), "plain object"); +assert.throws(TypeError, () => second.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => second.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/branding.js new file mode 100644 index 0000000000..c516e4d2c5 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/branding.js @@ -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.since +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const since = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => since.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/branding.js new file mode 100644 index 0000000000..8c29b1fc8e --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/branding.js @@ -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.subtract +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const subtract = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => subtract.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toJSON/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toJSON/branding.js new file mode 100644 index 0000000000..e9fcdb62b1 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toJSON/branding.js @@ -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.tojson +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toJSON = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toJSON.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..3f81e81149 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toLocaleString/branding.js @@ -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.tolocalestring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toLocaleString = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toLocaleString.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainDate/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainDate/branding.js new file mode 100644 index 0000000000..d6c346b8e1 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainDate/branding.js @@ -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.toplaindate +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainDate = Temporal.PlainDateTime.prototype.toPlainDate; + +assert.sameValue(typeof toPlainDate, "function"); + +assert.throws(TypeError, () => toPlainDate.call(undefined), "undefined"); +assert.throws(TypeError, () => toPlainDate.call(null), "null"); +assert.throws(TypeError, () => toPlainDate.call(true), "true"); +assert.throws(TypeError, () => toPlainDate.call(""), "empty string"); +assert.throws(TypeError, () => toPlainDate.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toPlainDate.call(1), "1"); +assert.throws(TypeError, () => toPlainDate.call({}), "plain object"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/branding.js new file mode 100644 index 0000000000..e8a63bb90b --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainMonthDay/branding.js @@ -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.toplainmonthday +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainMonthDay = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toPlainMonthDay.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainTime/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainTime/branding.js new file mode 100644 index 0000000000..4fc32cef67 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainTime/branding.js @@ -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.toplaintime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainTime = Temporal.PlainDateTime.prototype.toPlainTime; + +assert.sameValue(typeof toPlainTime, "function"); + +assert.throws(TypeError, () => toPlainTime.call(undefined), "undefined"); +assert.throws(TypeError, () => toPlainTime.call(null), "null"); +assert.throws(TypeError, () => toPlainTime.call(true), "true"); +assert.throws(TypeError, () => toPlainTime.call(""), "empty string"); +assert.throws(TypeError, () => toPlainTime.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toPlainTime.call(1), "1"); +assert.throws(TypeError, () => toPlainTime.call({}), "plain object"); +assert.throws(TypeError, () => toPlainTime.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toPlainTime.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/branding.js new file mode 100644 index 0000000000..0ce564e3ee --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toPlainYearMonth/branding.js @@ -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.toplainyearmonth +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainYearMonth = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toPlainYearMonth.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toString/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toString/branding.js new file mode 100644 index 0000000000..58cca42f67 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toString/branding.js @@ -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.tostring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toString = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toString.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js new file mode 100644 index 0000000000..e8f419afce --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js @@ -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.tozoneddatetime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toZonedDateTime = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/branding.js new file mode 100644 index 0000000000..d879f44b80 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/branding.js @@ -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.until +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const until = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => until.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/valueOf/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/valueOf/branding.js new file mode 100644 index 0000000000..6f99bbc1f3 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/valueOf/branding.js @@ -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.valueof +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const valueOf = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => valueOf.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/branding.js new file mode 100644 index 0000000000..6b09742503 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/branding.js @@ -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.weekofyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const weekOfYear = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => weekOfYear.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/with/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/with/branding.js new file mode 100644 index 0000000000..2b9421210c --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/with/branding.js @@ -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.with +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const with_ = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => with_.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js new file mode 100644 index 0000000000..6c001fb6ef --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js @@ -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.withcalendar +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withCalendar = Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => withCalendar.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/branding.js new file mode 100644 index 0000000000..e4d5ef4341 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/branding.js @@ -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.withplaindate +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withPlainDate = Temporal.PlainDateTime.prototype.withPlainDate; + +assert.sameValue(typeof withPlainDate, "function"); + +assert.throws(TypeError, () => withPlainDate.call(undefined), "undefined"); +assert.throws(TypeError, () => withPlainDate.call(null), "null"); +assert.throws(TypeError, () => withPlainDate.call(true), "true"); +assert.throws(TypeError, () => withPlainDate.call(""), "empty string"); +assert.throws(TypeError, () => withPlainDate.call(Symbol()), "symbol"); +assert.throws(TypeError, () => withPlainDate.call(1), "1"); +assert.throws(TypeError, () => withPlainDate.call({}), "plain object"); +assert.throws(TypeError, () => withPlainDate.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => withPlainDate.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/branding.js new file mode 100644 index 0000000000..90c823bb1c --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/branding.js @@ -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.withplaintime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withPlainTime = Temporal.PlainDateTime.prototype.withPlainTime; + +assert.sameValue(typeof withPlainTime, "function"); + +assert.throws(TypeError, () => withPlainTime.call(undefined), "undefined"); +assert.throws(TypeError, () => withPlainTime.call(null), "null"); +assert.throws(TypeError, () => withPlainTime.call(true), "true"); +assert.throws(TypeError, () => withPlainTime.call(""), "empty string"); +assert.throws(TypeError, () => withPlainTime.call(Symbol()), "symbol"); +assert.throws(TypeError, () => withPlainTime.call(1), "1"); +assert.throws(TypeError, () => withPlainTime.call({}), "plain object"); +assert.throws(TypeError, () => withPlainTime.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => withPlainTime.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/year/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/year/branding.js new file mode 100644 index 0000000000..afd2f206e5 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/year/branding.js @@ -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.year +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const year = Object.getOwnPropertyDescriptor(Temporal.PlainDateTime.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.PlainDateTime), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => year.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/calendar/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/calendar/branding.js new file mode 100644 index 0000000000..adf20ff9ae --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/calendar/branding.js @@ -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.plainmonthday.prototype.calendar +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const calendar = Object.getOwnPropertyDescriptor(Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => calendar.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/day/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/day/branding.js new file mode 100644 index 0000000000..3c8d274e39 --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/day/branding.js @@ -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.plainmonthday.prototype.day +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const day = Object.getOwnPropertyDescriptor(Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => day.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js new file mode 100644 index 0000000000..88bb5ad25a --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js @@ -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.plainmonthday.prototype.equals +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const equals = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => equals.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/branding.js new file mode 100644 index 0000000000..9a9805250c --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/branding.js @@ -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.plainmonthday.prototype.getisofields +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getISOFields = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => getISOFields.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/monthCode/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/monthCode/branding.js new file mode 100644 index 0000000000..9f511333e1 --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/monthCode/branding.js @@ -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.plainmonthday.prototype.monthcode +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthCode = Object.getOwnPropertyDescriptor(Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => monthCode.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toJSON/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toJSON/branding.js new file mode 100644 index 0000000000..996ffd883f --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toJSON/branding.js @@ -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.plainmonthday.prototype.tojson +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toJSON = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => toJSON.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..273b40964b --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toLocaleString/branding.js @@ -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.plainmonthday.prototype.tolocalestring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toLocaleString = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => toLocaleString.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/branding.js new file mode 100644 index 0000000000..eb321664b3 --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/branding.js @@ -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.plainmonthday.prototype.toplaindate +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainDate = Temporal.PlainMonthDay.prototype.toPlainDate; + +assert.sameValue(typeof toPlainDate, "function"); + +assert.throws(TypeError, () => toPlainDate.call(undefined), "undefined"); +assert.throws(TypeError, () => toPlainDate.call(null), "null"); +assert.throws(TypeError, () => toPlainDate.call(true), "true"); +assert.throws(TypeError, () => toPlainDate.call(""), "empty string"); +assert.throws(TypeError, () => toPlainDate.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toPlainDate.call(1), "1"); +assert.throws(TypeError, () => toPlainDate.call({}), "plain object"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toString/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toString/branding.js new file mode 100644 index 0000000000..2388be21ef --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toString/branding.js @@ -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.plainmonthday.prototype.tostring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toString = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => toString.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/valueOf/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/valueOf/branding.js new file mode 100644 index 0000000000..354f67906b --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/valueOf/branding.js @@ -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.plainmonthday.prototype.valueof +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const valueOf = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => valueOf.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/with/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/with/branding.js new file mode 100644 index 0000000000..e178fbad23 --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/with/branding.js @@ -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.plainmonthday.prototype.with +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const with_ = Temporal.PlainMonthDay.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.PlainMonthDay), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => with_.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/add/branding.js b/test/built-ins/Temporal/PlainTime/prototype/add/branding.js new file mode 100644 index 0000000000..681834574b --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/add/branding.js @@ -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.plaintime.prototype.add +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const add = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => add.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/calendar/branding.js b/test/built-ins/Temporal/PlainTime/prototype/calendar/branding.js new file mode 100644 index 0000000000..ccf2de2a6c --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/calendar/branding.js @@ -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.plaintime.prototype.calendar +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const calendar = Object.getOwnPropertyDescriptor(Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => calendar.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/equals/branding.js b/test/built-ins/Temporal/PlainTime/prototype/equals/branding.js new file mode 100644 index 0000000000..350a74dd43 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/equals/branding.js @@ -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.plaintime.prototype.equals +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const equals = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => equals.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/branding.js new file mode 100644 index 0000000000..523925b7b8 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/branding.js @@ -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.plaintime.prototype.getisofields +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getISOFields = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => getISOFields.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/hour/branding.js b/test/built-ins/Temporal/PlainTime/prototype/hour/branding.js new file mode 100644 index 0000000000..586b32246f --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/hour/branding.js @@ -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.plaintime.prototype.hour +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const hour = Object.getOwnPropertyDescriptor(Temporal.PlainTime.prototype, "hour").get; + +assert.sameValue(typeof hour, "function"); + +assert.throws(TypeError, () => hour.call(undefined), "undefined"); +assert.throws(TypeError, () => hour.call(null), "null"); +assert.throws(TypeError, () => hour.call(true), "true"); +assert.throws(TypeError, () => hour.call(""), "empty string"); +assert.throws(TypeError, () => hour.call(Symbol()), "symbol"); +assert.throws(TypeError, () => hour.call(1), "1"); +assert.throws(TypeError, () => hour.call({}), "plain object"); +assert.throws(TypeError, () => hour.call(Temporal.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => hour.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/microsecond/branding.js b/test/built-ins/Temporal/PlainTime/prototype/microsecond/branding.js new file mode 100644 index 0000000000..9054ea3f86 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/microsecond/branding.js @@ -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.plaintime.prototype.microsecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const microsecond = Object.getOwnPropertyDescriptor(Temporal.PlainTime.prototype, "microsecond").get; + +assert.sameValue(typeof microsecond, "function"); + +assert.throws(TypeError, () => microsecond.call(undefined), "undefined"); +assert.throws(TypeError, () => microsecond.call(null), "null"); +assert.throws(TypeError, () => microsecond.call(true), "true"); +assert.throws(TypeError, () => microsecond.call(""), "empty string"); +assert.throws(TypeError, () => microsecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => microsecond.call(1), "1"); +assert.throws(TypeError, () => microsecond.call({}), "plain object"); +assert.throws(TypeError, () => microsecond.call(Temporal.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => microsecond.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/millisecond/branding.js b/test/built-ins/Temporal/PlainTime/prototype/millisecond/branding.js new file mode 100644 index 0000000000..19c62c4b2d --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/millisecond/branding.js @@ -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.plaintime.prototype.millisecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const millisecond = Object.getOwnPropertyDescriptor(Temporal.PlainTime.prototype, "millisecond").get; + +assert.sameValue(typeof millisecond, "function"); + +assert.throws(TypeError, () => millisecond.call(undefined), "undefined"); +assert.throws(TypeError, () => millisecond.call(null), "null"); +assert.throws(TypeError, () => millisecond.call(true), "true"); +assert.throws(TypeError, () => millisecond.call(""), "empty string"); +assert.throws(TypeError, () => millisecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => millisecond.call(1), "1"); +assert.throws(TypeError, () => millisecond.call({}), "plain object"); +assert.throws(TypeError, () => millisecond.call(Temporal.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => millisecond.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/minute/branding.js b/test/built-ins/Temporal/PlainTime/prototype/minute/branding.js new file mode 100644 index 0000000000..bd05ddebf3 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/minute/branding.js @@ -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.plaintime.prototype.minute +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const minute = Object.getOwnPropertyDescriptor(Temporal.PlainTime.prototype, "minute").get; + +assert.sameValue(typeof minute, "function"); + +assert.throws(TypeError, () => minute.call(undefined), "undefined"); +assert.throws(TypeError, () => minute.call(null), "null"); +assert.throws(TypeError, () => minute.call(true), "true"); +assert.throws(TypeError, () => minute.call(""), "empty string"); +assert.throws(TypeError, () => minute.call(Symbol()), "symbol"); +assert.throws(TypeError, () => minute.call(1), "1"); +assert.throws(TypeError, () => minute.call({}), "plain object"); +assert.throws(TypeError, () => minute.call(Temporal.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => minute.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/nanosecond/branding.js b/test/built-ins/Temporal/PlainTime/prototype/nanosecond/branding.js new file mode 100644 index 0000000000..b4c3354f48 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/nanosecond/branding.js @@ -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.plaintime.prototype.nanosecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const nanosecond = Object.getOwnPropertyDescriptor(Temporal.PlainTime.prototype, "nanosecond").get; + +assert.sameValue(typeof nanosecond, "function"); + +assert.throws(TypeError, () => nanosecond.call(undefined), "undefined"); +assert.throws(TypeError, () => nanosecond.call(null), "null"); +assert.throws(TypeError, () => nanosecond.call(true), "true"); +assert.throws(TypeError, () => nanosecond.call(""), "empty string"); +assert.throws(TypeError, () => nanosecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => nanosecond.call(1), "1"); +assert.throws(TypeError, () => nanosecond.call({}), "plain object"); +assert.throws(TypeError, () => nanosecond.call(Temporal.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => nanosecond.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/round/branding.js b/test/built-ins/Temporal/PlainTime/prototype/round/branding.js new file mode 100644 index 0000000000..e476134418 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/round/branding.js @@ -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.plaintime.prototype.round +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const round = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => round.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/second/branding.js b/test/built-ins/Temporal/PlainTime/prototype/second/branding.js new file mode 100644 index 0000000000..e984aaa80b --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/second/branding.js @@ -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.plaintime.prototype.second +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const second = Object.getOwnPropertyDescriptor(Temporal.PlainTime.prototype, "second").get; + +assert.sameValue(typeof second, "function"); + +assert.throws(TypeError, () => second.call(undefined), "undefined"); +assert.throws(TypeError, () => second.call(null), "null"); +assert.throws(TypeError, () => second.call(true), "true"); +assert.throws(TypeError, () => second.call(""), "empty string"); +assert.throws(TypeError, () => second.call(Symbol()), "symbol"); +assert.throws(TypeError, () => second.call(1), "1"); +assert.throws(TypeError, () => second.call({}), "plain object"); +assert.throws(TypeError, () => second.call(Temporal.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => second.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/since/branding.js b/test/built-ins/Temporal/PlainTime/prototype/since/branding.js new file mode 100644 index 0000000000..632ee5c8b3 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/since/branding.js @@ -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.plaintime.prototype.since +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const since = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => since.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/subtract/branding.js b/test/built-ins/Temporal/PlainTime/prototype/subtract/branding.js new file mode 100644 index 0000000000..503d158caa --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/subtract/branding.js @@ -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.plaintime.prototype.subtract +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const subtract = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => subtract.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toJSON/branding.js b/test/built-ins/Temporal/PlainTime/prototype/toJSON/branding.js new file mode 100644 index 0000000000..56b534e217 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toJSON/branding.js @@ -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.plaintime.prototype.tojson +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toJSON = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => toJSON.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/PlainTime/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..bacc0ea7bf --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toLocaleString/branding.js @@ -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.plaintime.prototype.tolocalestring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toLocaleString = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => toLocaleString.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/branding.js b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/branding.js new file mode 100644 index 0000000000..16a5cd64a0 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/branding.js @@ -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.plaintime.prototype.toplaindatetime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainDateTime = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => toPlainDateTime.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toString/branding.js b/test/built-ins/Temporal/PlainTime/prototype/toString/branding.js new file mode 100644 index 0000000000..903758004d --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toString/branding.js @@ -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.plaintime.prototype.tostring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toString = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => toString.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/branding.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/branding.js new file mode 100644 index 0000000000..870960fd5a --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/branding.js @@ -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.plaintime.prototype.tozoneddatetime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toZonedDateTime = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/until/branding.js b/test/built-ins/Temporal/PlainTime/prototype/until/branding.js new file mode 100644 index 0000000000..44234d5887 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/until/branding.js @@ -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.plaintime.prototype.until +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const until = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => until.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/valueOf/branding.js b/test/built-ins/Temporal/PlainTime/prototype/valueOf/branding.js new file mode 100644 index 0000000000..a92145f42e --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/valueOf/branding.js @@ -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.plaintime.prototype.valueof +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const valueOf = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => valueOf.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/with/branding.js b/test/built-ins/Temporal/PlainTime/prototype/with/branding.js new file mode 100644 index 0000000000..e67ed99889 --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/with/branding.js @@ -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.plaintime.prototype.with +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const with_ = Temporal.PlainTime.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.PlainTime), "Temporal.PlainTime"); +assert.throws(TypeError, () => with_.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/add/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/add/branding.js new file mode 100644 index 0000000000..e7b67165b7 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/add/branding.js @@ -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.plainyearmonth.prototype.add +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const add = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => add.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/calendar/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/calendar/branding.js new file mode 100644 index 0000000000..4235571465 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/calendar/branding.js @@ -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.plainyearmonth.prototype.calendar +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const calendar = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => calendar.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/daysInMonth/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/daysInMonth/branding.js new file mode 100644 index 0000000000..4e25ac2438 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/daysInMonth/branding.js @@ -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.plainyearmonth.prototype.daysinmonth +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const daysInMonth = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => daysInMonth.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/branding.js new file mode 100644 index 0000000000..89ed0ba7de --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/branding.js @@ -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.plainyearmonth.prototype.daysinyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const daysInYear = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => daysInYear.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/branding.js new file mode 100644 index 0000000000..b180108229 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/branding.js @@ -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.plainyearmonth.prototype.equals +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const equals = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => equals.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/era/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/era/branding.js new file mode 100644 index 0000000000..805de77423 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/era/branding.js @@ -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.plainyearmonth.prototype.era +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const era = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => era.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/eraYear/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/eraYear/branding.js new file mode 100644 index 0000000000..23717f31e6 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/eraYear/branding.js @@ -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.plainyearmonth.prototype.erayear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const eraYear = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => eraYear.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/branding.js new file mode 100644 index 0000000000..88fe8f8e85 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/branding.js @@ -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.plainyearmonth.prototype.getisofields +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getISOFields = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => getISOFields.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/inLeapYear/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/inLeapYear/branding.js new file mode 100644 index 0000000000..ca4d439025 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/inLeapYear/branding.js @@ -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.plainyearmonth.prototype.inleapyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const inLeapYear = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => inLeapYear.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/month/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/month/branding.js new file mode 100644 index 0000000000..ff3991403b --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/month/branding.js @@ -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.plainyearmonth.prototype.month +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const month = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => month.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/monthCode/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/monthCode/branding.js new file mode 100644 index 0000000000..92ce886eb9 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/monthCode/branding.js @@ -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.plainyearmonth.prototype.monthcode +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthCode = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => monthCode.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/monthsInYear/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/monthsInYear/branding.js new file mode 100644 index 0000000000..51f5f1e096 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/monthsInYear/branding.js @@ -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.plainyearmonth.prototype.monthsinyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthsInYear = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => monthsInYear.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/branding.js new file mode 100644 index 0000000000..f7327b4124 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/branding.js @@ -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.plainyearmonth.prototype.since +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const since = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => since.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/branding.js new file mode 100644 index 0000000000..cc60497b07 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/branding.js @@ -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.plainyearmonth.prototype.subtract +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const subtract = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => subtract.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/toJSON/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/toJSON/branding.js new file mode 100644 index 0000000000..18aada90e6 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/toJSON/branding.js @@ -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.plainyearmonth.prototype.tojson +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toJSON = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => toJSON.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..62f18afc6a --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/toLocaleString/branding.js @@ -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.plainyearmonth.prototype.tolocalestring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toLocaleString = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => toLocaleString.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/branding.js new file mode 100644 index 0000000000..67d16016cb --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/branding.js @@ -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.plainyearmonth.prototype.toplaindate +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainDate = Temporal.PlainYearMonth.prototype.toPlainDate; + +assert.sameValue(typeof toPlainDate, "function"); + +assert.throws(TypeError, () => toPlainDate.call(undefined), "undefined"); +assert.throws(TypeError, () => toPlainDate.call(null), "null"); +assert.throws(TypeError, () => toPlainDate.call(true), "true"); +assert.throws(TypeError, () => toPlainDate.call(""), "empty string"); +assert.throws(TypeError, () => toPlainDate.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toPlainDate.call(1), "1"); +assert.throws(TypeError, () => toPlainDate.call({}), "plain object"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/toString/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/toString/branding.js new file mode 100644 index 0000000000..8f756e98bb --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/toString/branding.js @@ -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.plainyearmonth.prototype.tostring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toString = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => toString.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/branding.js new file mode 100644 index 0000000000..4487e20d8d --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/branding.js @@ -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.plainyearmonth.prototype.until +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const until = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => until.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/valueOf/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/valueOf/branding.js new file mode 100644 index 0000000000..a524512d8f --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/valueOf/branding.js @@ -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.plainyearmonth.prototype.valueof +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const valueOf = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => valueOf.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/with/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/with/branding.js new file mode 100644 index 0000000000..131d9f8c2e --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/with/branding.js @@ -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.plainyearmonth.prototype.with +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const with_ = Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => with_.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/year/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/year/branding.js new file mode 100644 index 0000000000..5e95acd81e --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/year/branding.js @@ -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.plainyearmonth.prototype.year +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const year = Object.getOwnPropertyDescriptor(Temporal.PlainYearMonth.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.PlainYearMonth), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => year.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/branding.js b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/branding.js new file mode 100644 index 0000000000..b8c570cadc --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/branding.js @@ -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.timezone.prototype.getinstantfor +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getInstantFor = Temporal.TimeZone.prototype.getInstantFor; + +assert.sameValue(typeof getInstantFor, "function"); + +assert.throws(TypeError, () => getInstantFor.call(undefined), "undefined"); +assert.throws(TypeError, () => getInstantFor.call(null), "null"); +assert.throws(TypeError, () => getInstantFor.call(true), "true"); +assert.throws(TypeError, () => getInstantFor.call(""), "empty string"); +assert.throws(TypeError, () => getInstantFor.call(Symbol()), "symbol"); +assert.throws(TypeError, () => getInstantFor.call(1), "1"); +assert.throws(TypeError, () => getInstantFor.call({}), "plain object"); +assert.throws(TypeError, () => getInstantFor.call(Temporal.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => getInstantFor.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getNextTransition/branding.js b/test/built-ins/Temporal/TimeZone/prototype/getNextTransition/branding.js new file mode 100644 index 0000000000..6a53945fab --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getNextTransition/branding.js @@ -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.timezone.prototype.getnexttransition +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getNextTransition = Temporal.TimeZone.prototype.getNextTransition; + +assert.sameValue(typeof getNextTransition, "function"); + +assert.throws(TypeError, () => getNextTransition.call(undefined), "undefined"); +assert.throws(TypeError, () => getNextTransition.call(null), "null"); +assert.throws(TypeError, () => getNextTransition.call(true), "true"); +assert.throws(TypeError, () => getNextTransition.call(""), "empty string"); +assert.throws(TypeError, () => getNextTransition.call(Symbol()), "symbol"); +assert.throws(TypeError, () => getNextTransition.call(1), "1"); +assert.throws(TypeError, () => getNextTransition.call({}), "plain object"); +assert.throws(TypeError, () => getNextTransition.call(Temporal.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => getNextTransition.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/branding.js b/test/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/branding.js new file mode 100644 index 0000000000..a63ebda0f7 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/branding.js @@ -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.timezone.prototype.getoffsetnanosecondsfor +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getOffsetNanosecondsFor = Temporal.TimeZone.prototype.getOffsetNanosecondsFor; + +assert.sameValue(typeof getOffsetNanosecondsFor, "function"); + +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(undefined), "undefined"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(null), "null"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(true), "true"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(""), "empty string"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(Symbol()), "symbol"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(1), "1"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call({}), "plain object"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(Temporal.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/branding.js b/test/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/branding.js new file mode 100644 index 0000000000..0fc6c49806 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/branding.js @@ -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.timezone.prototype.getoffsetstringfor +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getOffsetStringFor = Temporal.TimeZone.prototype.getOffsetStringFor; + +assert.sameValue(typeof getOffsetStringFor, "function"); + +assert.throws(TypeError, () => getOffsetStringFor.call(undefined), "undefined"); +assert.throws(TypeError, () => getOffsetStringFor.call(null), "null"); +assert.throws(TypeError, () => getOffsetStringFor.call(true), "true"); +assert.throws(TypeError, () => getOffsetStringFor.call(""), "empty string"); +assert.throws(TypeError, () => getOffsetStringFor.call(Symbol()), "symbol"); +assert.throws(TypeError, () => getOffsetStringFor.call(1), "1"); +assert.throws(TypeError, () => getOffsetStringFor.call({}), "plain object"); +assert.throws(TypeError, () => getOffsetStringFor.call(Temporal.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => getOffsetStringFor.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/branding.js b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/branding.js new file mode 100644 index 0000000000..431d3c520a --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/branding.js @@ -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.timezone.prototype.getpossibleinstantsfor +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getPossibleInstantsFor = Temporal.TimeZone.prototype.getPossibleInstantsFor; + +assert.sameValue(typeof getPossibleInstantsFor, "function"); + +assert.throws(TypeError, () => getPossibleInstantsFor.call(undefined), "undefined"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(null), "null"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(true), "true"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(""), "empty string"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(Symbol()), "symbol"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(1), "1"); +assert.throws(TypeError, () => getPossibleInstantsFor.call({}), "plain object"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(Temporal.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => getPossibleInstantsFor.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/branding.js b/test/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/branding.js new file mode 100644 index 0000000000..eaa3530e46 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/branding.js @@ -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.timezone.prototype.getprevioustransition +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getPreviousTransition = Temporal.TimeZone.prototype.getPreviousTransition; + +assert.sameValue(typeof getPreviousTransition, "function"); + +assert.throws(TypeError, () => getPreviousTransition.call(undefined), "undefined"); +assert.throws(TypeError, () => getPreviousTransition.call(null), "null"); +assert.throws(TypeError, () => getPreviousTransition.call(true), "true"); +assert.throws(TypeError, () => getPreviousTransition.call(""), "empty string"); +assert.throws(TypeError, () => getPreviousTransition.call(Symbol()), "symbol"); +assert.throws(TypeError, () => getPreviousTransition.call(1), "1"); +assert.throws(TypeError, () => getPreviousTransition.call({}), "plain object"); +assert.throws(TypeError, () => getPreviousTransition.call(Temporal.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => getPreviousTransition.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/toString/branding.js b/test/built-ins/Temporal/TimeZone/prototype/toString/branding.js new file mode 100644 index 0000000000..ab7654cc73 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/toString/branding.js @@ -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.timezone.prototype.tostring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toString = Temporal.TimeZone.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.TimeZone), "Temporal.TimeZone"); +assert.throws(TypeError, () => toString.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/add/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/add/branding.js new file mode 100644 index 0000000000..c9dc587495 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/add/branding.js @@ -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.zoneddatetime.prototype.add +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const add = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => add.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/calendar/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/calendar/branding.js new file mode 100644 index 0000000000..ba792ca71a --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/calendar/branding.js @@ -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.zoneddatetime.prototype.calendar +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const calendar = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => calendar.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/day/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/day/branding.js new file mode 100644 index 0000000000..adf6c9ed74 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/day/branding.js @@ -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.zoneddatetime.prototype.day +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const day = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => day.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/dayOfWeek/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/dayOfWeek/branding.js new file mode 100644 index 0000000000..e626ec9e31 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/dayOfWeek/branding.js @@ -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.zoneddatetime.prototype.dayofweek +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const dayOfWeek = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => dayOfWeek.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/dayOfYear/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/dayOfYear/branding.js new file mode 100644 index 0000000000..c593cb34ce --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/dayOfYear/branding.js @@ -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.zoneddatetime.prototype.dayofyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const dayOfYear = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => dayOfYear.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/daysInMonth/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInMonth/branding.js new file mode 100644 index 0000000000..710147ec8d --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInMonth/branding.js @@ -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.zoneddatetime.prototype.daysinmonth +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const daysInMonth = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => daysInMonth.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/daysInWeek/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInWeek/branding.js new file mode 100644 index 0000000000..f385d8b326 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInWeek/branding.js @@ -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.zoneddatetime.prototype.daysinweek +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const daysInWeek = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => daysInWeek.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/daysInYear/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInYear/branding.js new file mode 100644 index 0000000000..6720659c20 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInYear/branding.js @@ -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.zoneddatetime.prototype.daysinyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const daysInYear = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => daysInYear.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/branding.js new file mode 100644 index 0000000000..5957b64c80 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/branding.js @@ -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.zoneddatetime.prototype.epochmicroseconds +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const epochMicroseconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => epochMicroseconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMilliseconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMilliseconds/branding.js new file mode 100644 index 0000000000..091e0ad84c --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMilliseconds/branding.js @@ -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.zoneddatetime.prototype.epochmilliseconds +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const epochMilliseconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => epochMilliseconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/branding.js new file mode 100644 index 0000000000..39fb55a8c5 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/epochNanoseconds/branding.js @@ -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.zoneddatetime.prototype.epochnanoseconds +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const epochNanoseconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => epochNanoseconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/branding.js new file mode 100644 index 0000000000..9f68f73d1e --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/branding.js @@ -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.zoneddatetime.prototype.epochseconds +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const epochSeconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => epochSeconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js new file mode 100644 index 0000000000..05705c4d7c --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js @@ -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.zoneddatetime.prototype.equals +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const equals = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => equals.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/era/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/era/branding.js new file mode 100644 index 0000000000..9e66ba1223 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/era/branding.js @@ -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.zoneddatetime.prototype.era +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const era = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => era.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/eraYear/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/eraYear/branding.js new file mode 100644 index 0000000000..f3a0d105c0 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/eraYear/branding.js @@ -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.zoneddatetime.prototype.erayear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const eraYear = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => eraYear.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/branding.js new file mode 100644 index 0000000000..9524ed7e60 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/branding.js @@ -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.zoneddatetime.prototype.getisofields +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const getISOFields = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => getISOFields.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/hour/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/hour/branding.js new file mode 100644 index 0000000000..d080fcecbf --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/hour/branding.js @@ -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.zoneddatetime.prototype.hour +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const hour = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "hour").get; + +assert.sameValue(typeof hour, "function"); + +assert.throws(TypeError, () => hour.call(undefined), "undefined"); +assert.throws(TypeError, () => hour.call(null), "null"); +assert.throws(TypeError, () => hour.call(true), "true"); +assert.throws(TypeError, () => hour.call(""), "empty string"); +assert.throws(TypeError, () => hour.call(Symbol()), "symbol"); +assert.throws(TypeError, () => hour.call(1), "1"); +assert.throws(TypeError, () => hour.call({}), "plain object"); +assert.throws(TypeError, () => hour.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => hour.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/branding.js new file mode 100644 index 0000000000..65dd234131 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/branding.js @@ -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.zoneddatetime.prototype.hoursinday +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const hoursInDay = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "hoursInDay").get; + +assert.sameValue(typeof hoursInDay, "function"); + +assert.throws(TypeError, () => hoursInDay.call(undefined), "undefined"); +assert.throws(TypeError, () => hoursInDay.call(null), "null"); +assert.throws(TypeError, () => hoursInDay.call(true), "true"); +assert.throws(TypeError, () => hoursInDay.call(""), "empty string"); +assert.throws(TypeError, () => hoursInDay.call(Symbol()), "symbol"); +assert.throws(TypeError, () => hoursInDay.call(1), "1"); +assert.throws(TypeError, () => hoursInDay.call({}), "plain object"); +assert.throws(TypeError, () => hoursInDay.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => hoursInDay.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/inLeapYear/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/inLeapYear/branding.js new file mode 100644 index 0000000000..edf5df8cf8 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/inLeapYear/branding.js @@ -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.zoneddatetime.prototype.inleapyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const inLeapYear = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => inLeapYear.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/microsecond/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/microsecond/branding.js new file mode 100644 index 0000000000..28861479f9 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/microsecond/branding.js @@ -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.zoneddatetime.prototype.microsecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const microsecond = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "microsecond").get; + +assert.sameValue(typeof microsecond, "function"); + +assert.throws(TypeError, () => microsecond.call(undefined), "undefined"); +assert.throws(TypeError, () => microsecond.call(null), "null"); +assert.throws(TypeError, () => microsecond.call(true), "true"); +assert.throws(TypeError, () => microsecond.call(""), "empty string"); +assert.throws(TypeError, () => microsecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => microsecond.call(1), "1"); +assert.throws(TypeError, () => microsecond.call({}), "plain object"); +assert.throws(TypeError, () => microsecond.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => microsecond.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/millisecond/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/millisecond/branding.js new file mode 100644 index 0000000000..2a243a975a --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/millisecond/branding.js @@ -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.zoneddatetime.prototype.millisecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const millisecond = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "millisecond").get; + +assert.sameValue(typeof millisecond, "function"); + +assert.throws(TypeError, () => millisecond.call(undefined), "undefined"); +assert.throws(TypeError, () => millisecond.call(null), "null"); +assert.throws(TypeError, () => millisecond.call(true), "true"); +assert.throws(TypeError, () => millisecond.call(""), "empty string"); +assert.throws(TypeError, () => millisecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => millisecond.call(1), "1"); +assert.throws(TypeError, () => millisecond.call({}), "plain object"); +assert.throws(TypeError, () => millisecond.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => millisecond.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/minute/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/minute/branding.js new file mode 100644 index 0000000000..0d354cf111 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/minute/branding.js @@ -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.zoneddatetime.prototype.minute +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const minute = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "minute").get; + +assert.sameValue(typeof minute, "function"); + +assert.throws(TypeError, () => minute.call(undefined), "undefined"); +assert.throws(TypeError, () => minute.call(null), "null"); +assert.throws(TypeError, () => minute.call(true), "true"); +assert.throws(TypeError, () => minute.call(""), "empty string"); +assert.throws(TypeError, () => minute.call(Symbol()), "symbol"); +assert.throws(TypeError, () => minute.call(1), "1"); +assert.throws(TypeError, () => minute.call({}), "plain object"); +assert.throws(TypeError, () => minute.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => minute.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/month/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/month/branding.js new file mode 100644 index 0000000000..763f424375 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/month/branding.js @@ -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.zoneddatetime.prototype.month +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const month = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => month.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/monthCode/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/monthCode/branding.js new file mode 100644 index 0000000000..c6bbd04373 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/monthCode/branding.js @@ -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.zoneddatetime.prototype.monthcode +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthCode = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => monthCode.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/monthsInYear/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/monthsInYear/branding.js new file mode 100644 index 0000000000..c6df1292d2 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/monthsInYear/branding.js @@ -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.zoneddatetime.prototype.monthsinyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const monthsInYear = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => monthsInYear.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/nanosecond/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/nanosecond/branding.js new file mode 100644 index 0000000000..a0f6e8fe29 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/nanosecond/branding.js @@ -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.zoneddatetime.prototype.nanosecond +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const nanosecond = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "nanosecond").get; + +assert.sameValue(typeof nanosecond, "function"); + +assert.throws(TypeError, () => nanosecond.call(undefined), "undefined"); +assert.throws(TypeError, () => nanosecond.call(null), "null"); +assert.throws(TypeError, () => nanosecond.call(true), "true"); +assert.throws(TypeError, () => nanosecond.call(""), "empty string"); +assert.throws(TypeError, () => nanosecond.call(Symbol()), "symbol"); +assert.throws(TypeError, () => nanosecond.call(1), "1"); +assert.throws(TypeError, () => nanosecond.call({}), "plain object"); +assert.throws(TypeError, () => nanosecond.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => nanosecond.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/offset/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/offset/branding.js new file mode 100644 index 0000000000..4a4262d43b --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/offset/branding.js @@ -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.zoneddatetime.prototype.offset +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const offset = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "offset").get; + +assert.sameValue(typeof offset, "function"); + +assert.throws(TypeError, () => offset.call(undefined), "undefined"); +assert.throws(TypeError, () => offset.call(null), "null"); +assert.throws(TypeError, () => offset.call(true), "true"); +assert.throws(TypeError, () => offset.call(""), "empty string"); +assert.throws(TypeError, () => offset.call(Symbol()), "symbol"); +assert.throws(TypeError, () => offset.call(1), "1"); +assert.throws(TypeError, () => offset.call({}), "plain object"); +assert.throws(TypeError, () => offset.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => offset.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/offsetNanoseconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/offsetNanoseconds/branding.js new file mode 100644 index 0000000000..26d46fe656 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/offsetNanoseconds/branding.js @@ -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.zoneddatetime.prototype.offsetnanoseconds +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const offsetNanoseconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "offsetNanoseconds").get; + +assert.sameValue(typeof offsetNanoseconds, "function"); + +assert.throws(TypeError, () => offsetNanoseconds.call(undefined), "undefined"); +assert.throws(TypeError, () => offsetNanoseconds.call(null), "null"); +assert.throws(TypeError, () => offsetNanoseconds.call(true), "true"); +assert.throws(TypeError, () => offsetNanoseconds.call(""), "empty string"); +assert.throws(TypeError, () => offsetNanoseconds.call(Symbol()), "symbol"); +assert.throws(TypeError, () => offsetNanoseconds.call(1), "1"); +assert.throws(TypeError, () => offsetNanoseconds.call({}), "plain object"); +assert.throws(TypeError, () => offsetNanoseconds.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => offsetNanoseconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/round/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/round/branding.js new file mode 100644 index 0000000000..f0b708e841 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/round/branding.js @@ -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.zoneddatetime.prototype.round +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const round = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => round.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/second/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/second/branding.js new file mode 100644 index 0000000000..0ff1691779 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/second/branding.js @@ -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.zoneddatetime.prototype.second +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const second = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "second").get; + +assert.sameValue(typeof second, "function"); + +assert.throws(TypeError, () => second.call(undefined), "undefined"); +assert.throws(TypeError, () => second.call(null), "null"); +assert.throws(TypeError, () => second.call(true), "true"); +assert.throws(TypeError, () => second.call(""), "empty string"); +assert.throws(TypeError, () => second.call(Symbol()), "symbol"); +assert.throws(TypeError, () => second.call(1), "1"); +assert.throws(TypeError, () => second.call({}), "plain object"); +assert.throws(TypeError, () => second.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => second.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js new file mode 100644 index 0000000000..2676e647af --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js @@ -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.zoneddatetime.prototype.since +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const since = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => since.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/branding.js new file mode 100644 index 0000000000..9877e2aa59 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/branding.js @@ -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.zoneddatetime.prototype.startofday +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const startOfDay = Temporal.ZonedDateTime.prototype.startOfDay; + +assert.sameValue(typeof startOfDay, "function"); + +assert.throws(TypeError, () => startOfDay.call(undefined), "undefined"); +assert.throws(TypeError, () => startOfDay.call(null), "null"); +assert.throws(TypeError, () => startOfDay.call(true), "true"); +assert.throws(TypeError, () => startOfDay.call(""), "empty string"); +assert.throws(TypeError, () => startOfDay.call(Symbol()), "symbol"); +assert.throws(TypeError, () => startOfDay.call(1), "1"); +assert.throws(TypeError, () => startOfDay.call({}), "plain object"); +assert.throws(TypeError, () => startOfDay.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => startOfDay.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/branding.js new file mode 100644 index 0000000000..0dcb416836 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/branding.js @@ -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.zoneddatetime.prototype.subtract +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const subtract = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => subtract.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/timeZone/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/timeZone/branding.js new file mode 100644 index 0000000000..15ac6fc049 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/timeZone/branding.js @@ -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.zoneddatetime.prototype.timezone +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const timeZone = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "timeZone").get; + +assert.sameValue(typeof timeZone, "function"); + +assert.throws(TypeError, () => timeZone.call(undefined), "undefined"); +assert.throws(TypeError, () => timeZone.call(null), "null"); +assert.throws(TypeError, () => timeZone.call(true), "true"); +assert.throws(TypeError, () => timeZone.call(""), "empty string"); +assert.throws(TypeError, () => timeZone.call(Symbol()), "symbol"); +assert.throws(TypeError, () => timeZone.call(1), "1"); +assert.throws(TypeError, () => timeZone.call({}), "plain object"); +assert.throws(TypeError, () => timeZone.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => timeZone.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toInstant/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toInstant/branding.js new file mode 100644 index 0000000000..f3285c1d55 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toInstant/branding.js @@ -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.zoneddatetime.prototype.toinstant +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toInstant = Temporal.ZonedDateTime.prototype.toInstant; + +assert.sameValue(typeof toInstant, "function"); + +assert.throws(TypeError, () => toInstant.call(undefined), "undefined"); +assert.throws(TypeError, () => toInstant.call(null), "null"); +assert.throws(TypeError, () => toInstant.call(true), "true"); +assert.throws(TypeError, () => toInstant.call(""), "empty string"); +assert.throws(TypeError, () => toInstant.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toInstant.call(1), "1"); +assert.throws(TypeError, () => toInstant.call({}), "plain object"); +assert.throws(TypeError, () => toInstant.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toInstant.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/branding.js new file mode 100644 index 0000000000..ac81e4c9f9 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/branding.js @@ -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.zoneddatetime.prototype.tojson +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toJSON = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toJSON.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toLocaleString/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toLocaleString/branding.js new file mode 100644 index 0000000000..1a6f091be1 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toLocaleString/branding.js @@ -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.zoneddatetime.prototype.tolocalestring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toLocaleString = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toLocaleString.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainDate/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainDate/branding.js new file mode 100644 index 0000000000..d5e774a56a --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainDate/branding.js @@ -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.zoneddatetime.prototype.toplaindate +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainDate = Temporal.ZonedDateTime.prototype.toPlainDate; + +assert.sameValue(typeof toPlainDate, "function"); + +assert.throws(TypeError, () => toPlainDate.call(undefined), "undefined"); +assert.throws(TypeError, () => toPlainDate.call(null), "null"); +assert.throws(TypeError, () => toPlainDate.call(true), "true"); +assert.throws(TypeError, () => toPlainDate.call(""), "empty string"); +assert.throws(TypeError, () => toPlainDate.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toPlainDate.call(1), "1"); +assert.throws(TypeError, () => toPlainDate.call({}), "plain object"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toPlainDate.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainDateTime/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainDateTime/branding.js new file mode 100644 index 0000000000..8cd4ee4943 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainDateTime/branding.js @@ -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.zoneddatetime.prototype.toplaindatetime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainDateTime = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toPlainDateTime.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/branding.js new file mode 100644 index 0000000000..d758ea470e --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/branding.js @@ -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.zoneddatetime.prototype.toplainmonthday +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainMonthDay = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toPlainMonthDay.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainTime/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainTime/branding.js new file mode 100644 index 0000000000..2cc9ab9de8 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainTime/branding.js @@ -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.zoneddatetime.prototype.toplaintime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainTime = Temporal.ZonedDateTime.prototype.toPlainTime; + +assert.sameValue(typeof toPlainTime, "function"); + +assert.throws(TypeError, () => toPlainTime.call(undefined), "undefined"); +assert.throws(TypeError, () => toPlainTime.call(null), "null"); +assert.throws(TypeError, () => toPlainTime.call(true), "true"); +assert.throws(TypeError, () => toPlainTime.call(""), "empty string"); +assert.throws(TypeError, () => toPlainTime.call(Symbol()), "symbol"); +assert.throws(TypeError, () => toPlainTime.call(1), "1"); +assert.throws(TypeError, () => toPlainTime.call({}), "plain object"); +assert.throws(TypeError, () => toPlainTime.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toPlainTime.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/branding.js new file mode 100644 index 0000000000..772c7f4320 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/branding.js @@ -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.zoneddatetime.prototype.toplainyearmonth +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toPlainYearMonth = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toPlainYearMonth.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/branding.js new file mode 100644 index 0000000000..b07f47f7f1 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/branding.js @@ -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.zoneddatetime.prototype.tostring +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const toString = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => toString.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js new file mode 100644 index 0000000000..18210ae365 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js @@ -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.zoneddatetime.prototype.until +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const until = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => until.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/valueOf/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/valueOf/branding.js new file mode 100644 index 0000000000..910dca8913 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/valueOf/branding.js @@ -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.zoneddatetime.prototype.valueof +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const valueOf = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => valueOf.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/branding.js new file mode 100644 index 0000000000..3d6377f855 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/branding.js @@ -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.zoneddatetime.prototype.weekofyear +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const weekOfYear = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => weekOfYear.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/branding.js new file mode 100644 index 0000000000..2d9fa03c67 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/branding.js @@ -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.zoneddatetime.prototype.with +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const with_ = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => with_.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js new file mode 100644 index 0000000000..4958c2884c --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js @@ -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.zoneddatetime.prototype.withcalendar +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withCalendar = Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withCalendar.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/branding.js new file mode 100644 index 0000000000..5d9df4cbfb --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/branding.js @@ -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.zoneddatetime.prototype.withplaindate +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withPlainDate = Temporal.ZonedDateTime.prototype.withPlainDate; + +assert.sameValue(typeof withPlainDate, "function"); + +assert.throws(TypeError, () => withPlainDate.call(undefined), "undefined"); +assert.throws(TypeError, () => withPlainDate.call(null), "null"); +assert.throws(TypeError, () => withPlainDate.call(true), "true"); +assert.throws(TypeError, () => withPlainDate.call(""), "empty string"); +assert.throws(TypeError, () => withPlainDate.call(Symbol()), "symbol"); +assert.throws(TypeError, () => withPlainDate.call(1), "1"); +assert.throws(TypeError, () => withPlainDate.call({}), "plain object"); +assert.throws(TypeError, () => withPlainDate.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withPlainDate.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/branding.js new file mode 100644 index 0000000000..471e0f20d8 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/branding.js @@ -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.zoneddatetime.prototype.withplaintime +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withPlainTime = Temporal.ZonedDateTime.prototype.withPlainTime; + +assert.sameValue(typeof withPlainTime, "function"); + +assert.throws(TypeError, () => withPlainTime.call(undefined), "undefined"); +assert.throws(TypeError, () => withPlainTime.call(null), "null"); +assert.throws(TypeError, () => withPlainTime.call(true), "true"); +assert.throws(TypeError, () => withPlainTime.call(""), "empty string"); +assert.throws(TypeError, () => withPlainTime.call(Symbol()), "symbol"); +assert.throws(TypeError, () => withPlainTime.call(1), "1"); +assert.throws(TypeError, () => withPlainTime.call({}), "plain object"); +assert.throws(TypeError, () => withPlainTime.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withPlainTime.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js new file mode 100644 index 0000000000..15c0b3379f --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js @@ -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.zoneddatetime.prototype.withtimezone +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const withTimeZone = Temporal.ZonedDateTime.prototype.withTimeZone; + +assert.sameValue(typeof withTimeZone, "function"); + +assert.throws(TypeError, () => withTimeZone.call(undefined), "undefined"); +assert.throws(TypeError, () => withTimeZone.call(null), "null"); +assert.throws(TypeError, () => withTimeZone.call(true), "true"); +assert.throws(TypeError, () => withTimeZone.call(""), "empty string"); +assert.throws(TypeError, () => withTimeZone.call(Symbol()), "symbol"); +assert.throws(TypeError, () => withTimeZone.call(1), "1"); +assert.throws(TypeError, () => withTimeZone.call({}), "plain object"); +assert.throws(TypeError, () => withTimeZone.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withTimeZone.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/year/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/year/branding.js new file mode 100644 index 0000000000..2359e26b9a --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/year/branding.js @@ -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.zoneddatetime.prototype.year +description: Throw a TypeError if the receiver is invalid +features: [Symbol, Temporal] +---*/ + +const year = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.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.ZonedDateTime), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => year.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype");