diff --git a/test/built-ins/Temporal/Calendar/prototype/fields/branding.js b/test/built-ins/Temporal/Calendar/prototype/fields/branding.js index bd62883331..9b4225274c 100644 --- a/test/built-ins/Temporal/Calendar/prototype/fields/branding.js +++ b/test/built-ins/Temporal/Calendar/prototype/fields/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [[]]; + +assert.throws(TypeError, () => fields.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => fields.apply(null, args), "null"); +assert.throws(TypeError, () => fields.apply(true, args), "true"); +assert.throws(TypeError, () => fields.apply("", args), "empty string"); +assert.throws(TypeError, () => fields.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => fields.apply(1, args), "1"); +assert.throws(TypeError, () => fields.apply({}, args), "plain object"); +assert.throws(TypeError, () => fields.apply(Temporal.Calendar, args), "Temporal.Calendar"); +assert.throws(TypeError, () => fields.apply(Temporal.Calendar.prototype, args), "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 index 0ef2b3f84d..a1189bbb4d 100644 --- a/test/built-ins/Temporal/Calendar/prototype/mergeFields/branding.js +++ b/test/built-ins/Temporal/Calendar/prototype/mergeFields/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{}, {}]; + +assert.throws(TypeError, () => mergeFields.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => mergeFields.apply(null, args), "null"); +assert.throws(TypeError, () => mergeFields.apply(true, args), "true"); +assert.throws(TypeError, () => mergeFields.apply("", args), "empty string"); +assert.throws(TypeError, () => mergeFields.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => mergeFields.apply(1, args), "1"); +assert.throws(TypeError, () => mergeFields.apply({}, args), "plain object"); +assert.throws(TypeError, () => mergeFields.apply(Temporal.Calendar, args), "Temporal.Calendar"); +assert.throws(TypeError, () => mergeFields.apply(Temporal.Calendar.prototype, args), "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 index 63691c7c4b..05cefbf4f0 100644 --- a/test/built-ins/Temporal/Calendar/prototype/monthDayFromFields/branding.js +++ b/test/built-ins/Temporal/Calendar/prototype/monthDayFromFields/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ monthCode: "M01", day: 1 }]; + +assert.throws(TypeError, () => monthDayFromFields.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => monthDayFromFields.apply(null, args), "null"); +assert.throws(TypeError, () => monthDayFromFields.apply(true, args), "true"); +assert.throws(TypeError, () => monthDayFromFields.apply("", args), "empty string"); +assert.throws(TypeError, () => monthDayFromFields.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => monthDayFromFields.apply(1, args), "1"); +assert.throws(TypeError, () => monthDayFromFields.apply({}, args), "plain object"); +assert.throws(TypeError, () => monthDayFromFields.apply(Temporal.Calendar, args), "Temporal.Calendar"); +assert.throws(TypeError, () => monthDayFromFields.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype"); diff --git a/test/built-ins/Temporal/Duration/prototype/add/branding.js b/test/built-ins/Temporal/Duration/prototype/add/branding.js index e311bd44f8..efc325dd18 100644 --- a/test/built-ins/Temporal/Duration/prototype/add/branding.js +++ b/test/built-ins/Temporal/Duration/prototype/add/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(0, 0, 0, 0, 5)]; + +assert.throws(TypeError, () => add.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => add.apply(null, args), "null"); +assert.throws(TypeError, () => add.apply(true, args), "true"); +assert.throws(TypeError, () => add.apply("", args), "empty string"); +assert.throws(TypeError, () => add.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => add.apply(1, args), "1"); +assert.throws(TypeError, () => add.apply({}, args), "plain object"); +assert.throws(TypeError, () => add.apply(Temporal.Duration, args), "Temporal.Duration"); +assert.throws(TypeError, () => add.apply(Temporal.Duration.prototype, args), "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 index 503b77f9bf..8b5bc66c5a 100644 --- a/test/built-ins/Temporal/Duration/prototype/round/branding.js +++ b/test/built-ins/Temporal/Duration/prototype/round/branding.js @@ -11,12 +11,14 @@ 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"); +const args = ["hour"]; + +assert.throws(TypeError, () => round.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => round.apply(null, args), "null"); +assert.throws(TypeError, () => round.apply(true, args), "true"); +assert.throws(TypeError, () => round.apply("", args), "empty string"); +assert.throws(TypeError, () => round.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => round.apply(1, args), "1"); +assert.throws(TypeError, () => round.apply({}, args), "plain object"); +assert.throws(TypeError, () => round.apply(Temporal.Duration, args), "Temporal.Duration"); +assert.throws(TypeError, () => round.apply(Temporal.Duration.prototype, args), "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 index e9264d8e6f..f9dca06eac 100644 --- a/test/built-ins/Temporal/Duration/prototype/subtract/branding.js +++ b/test/built-ins/Temporal/Duration/prototype/subtract/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(0, 0, 0, 0, 5)]; + +assert.throws(TypeError, () => subtract.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => subtract.apply(null, args), "null"); +assert.throws(TypeError, () => subtract.apply(true, args), "true"); +assert.throws(TypeError, () => subtract.apply("", args), "empty string"); +assert.throws(TypeError, () => subtract.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => subtract.apply(1, args), "1"); +assert.throws(TypeError, () => subtract.apply({}, args), "plain object"); +assert.throws(TypeError, () => subtract.apply(Temporal.Duration, args), "Temporal.Duration"); +assert.throws(TypeError, () => subtract.apply(Temporal.Duration.prototype, args), "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 index a6841b0bce..325012abcf 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/branding.js +++ b/test/built-ins/Temporal/Duration/prototype/total/branding.js @@ -11,12 +11,14 @@ 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"); +const args = ["hour"]; + +assert.throws(TypeError, () => total.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => total.apply(null, args), "null"); +assert.throws(TypeError, () => total.apply(true, args), "true"); +assert.throws(TypeError, () => total.apply("", args), "empty string"); +assert.throws(TypeError, () => total.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => total.apply(1, args), "1"); +assert.throws(TypeError, () => total.apply({}, args), "plain object"); +assert.throws(TypeError, () => total.apply(Temporal.Duration, args), "Temporal.Duration"); +assert.throws(TypeError, () => total.apply(Temporal.Duration.prototype, args), "Temporal.Duration.prototype"); diff --git a/test/built-ins/Temporal/Instant/prototype/equals/branding.js b/test/built-ins/Temporal/Instant/prototype/equals/branding.js index 5aafe306d1..2a02133902 100644 --- a/test/built-ins/Temporal/Instant/prototype/equals/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Instant(123456n)]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.Instant, args), "Temporal.Instant"); +assert.throws(TypeError, () => equals.apply(Temporal.Instant.prototype, args), "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 index 116f31b767..72313830e6 100644 --- a/test/built-ins/Temporal/Instant/prototype/round/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/round/branding.js @@ -11,12 +11,14 @@ 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"); +const args = ["hour"]; + +assert.throws(TypeError, () => round.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => round.apply(null, args), "null"); +assert.throws(TypeError, () => round.apply(true, args), "true"); +assert.throws(TypeError, () => round.apply("", args), "empty string"); +assert.throws(TypeError, () => round.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => round.apply(1, args), "1"); +assert.throws(TypeError, () => round.apply({}, args), "plain object"); +assert.throws(TypeError, () => round.apply(Temporal.Instant, args), "Temporal.Instant"); +assert.throws(TypeError, () => round.apply(Temporal.Instant.prototype, args), "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 index 0716c625d0..87f70cd37e 100644 --- a/test/built-ins/Temporal/Instant/prototype/since/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/since/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Instant(123456n)]; + +assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => since.apply(null, args), "null"); +assert.throws(TypeError, () => since.apply(true, args), "true"); +assert.throws(TypeError, () => since.apply("", args), "empty string"); +assert.throws(TypeError, () => since.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => since.apply(1, args), "1"); +assert.throws(TypeError, () => since.apply({}, args), "plain object"); +assert.throws(TypeError, () => since.apply(Temporal.Instant, args), "Temporal.Instant"); +assert.throws(TypeError, () => since.apply(Temporal.Instant.prototype, args), "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 index 71409a387b..3c6820888b 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ calendar: new Temporal.Calendar("iso8601"), timeZone: new Temporal.TimeZone("UTC") }]; + +assert.throws(TypeError, () => toZonedDateTime.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toZonedDateTime.apply(null, args), "null"); +assert.throws(TypeError, () => toZonedDateTime.apply(true, args), "true"); +assert.throws(TypeError, () => toZonedDateTime.apply("", args), "empty string"); +assert.throws(TypeError, () => toZonedDateTime.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toZonedDateTime.apply(1, args), "1"); +assert.throws(TypeError, () => toZonedDateTime.apply({}, args), "plain object"); +assert.throws(TypeError, () => toZonedDateTime.apply(Temporal.Instant, args), "Temporal.Instant"); +assert.throws(TypeError, () => toZonedDateTime.apply(Temporal.Instant.prototype, args), "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 index 091591a1ce..a5997e2f01 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ timeZone: new Temporal.TimeZone("UTC") }]; + +assert.throws(TypeError, () => toZonedDateTimeISO.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply(null, args), "null"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply(true, args), "true"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply("", args), "empty string"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply(1, args), "1"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply({}, args), "plain object"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply(Temporal.Instant, args), "Temporal.Instant"); +assert.throws(TypeError, () => toZonedDateTimeISO.apply(Temporal.Instant.prototype, args), "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 index 70fb066c5e..6ccbce1363 100644 --- a/test/built-ins/Temporal/Instant/prototype/until/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/until/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Instant(123456n)]; + +assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => until.apply(null, args), "null"); +assert.throws(TypeError, () => until.apply(true, args), "true"); +assert.throws(TypeError, () => until.apply("", args), "empty string"); +assert.throws(TypeError, () => until.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => until.apply(1, args), "1"); +assert.throws(TypeError, () => until.apply({}, args), "plain object"); +assert.throws(TypeError, () => until.apply(Temporal.Instant, args), "Temporal.Instant"); +assert.throws(TypeError, () => until.apply(Temporal.Instant.prototype, args), "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 index b60ec44d51..fe9b3362e7 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/add/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/add/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => add.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => add.apply(null, args), "null"); +assert.throws(TypeError, () => add.apply(true, args), "true"); +assert.throws(TypeError, () => add.apply("", args), "empty string"); +assert.throws(TypeError, () => add.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => add.apply(1, args), "1"); +assert.throws(TypeError, () => add.apply({}, args), "plain object"); +assert.throws(TypeError, () => add.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => add.apply(Temporal.PlainDate.prototype, args), "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 index 58c78e622f..c2d95769c0 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/equals/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDate(2022, 6, 22)]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainDate.prototype, args), "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 index 7b7ea57483..e1c3b17aba 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/since/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/since/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDate(2022, 6, 22)]; + +assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => since.apply(null, args), "null"); +assert.throws(TypeError, () => since.apply(true, args), "true"); +assert.throws(TypeError, () => since.apply("", args), "empty string"); +assert.throws(TypeError, () => since.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => since.apply(1, args), "1"); +assert.throws(TypeError, () => since.apply({}, args), "plain object"); +assert.throws(TypeError, () => since.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => since.apply(Temporal.PlainDate.prototype, args), "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 index fb89bca42b..dfc9dd64f9 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/subtract/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/subtract/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => subtract.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => subtract.apply(null, args), "null"); +assert.throws(TypeError, () => subtract.apply(true, args), "true"); +assert.throws(TypeError, () => subtract.apply("", args), "empty string"); +assert.throws(TypeError, () => subtract.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => subtract.apply(1, args), "1"); +assert.throws(TypeError, () => subtract.apply({}, args), "plain object"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainDate.prototype, args), "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 index 7d20da46b1..6ef14dad48 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.TimeZone("UTC")]; + +assert.throws(TypeError, () => toZonedDateTime.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toZonedDateTime.apply(null, args), "null"); +assert.throws(TypeError, () => toZonedDateTime.apply(true, args), "true"); +assert.throws(TypeError, () => toZonedDateTime.apply("", args), "empty string"); +assert.throws(TypeError, () => toZonedDateTime.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toZonedDateTime.apply(1, args), "1"); +assert.throws(TypeError, () => toZonedDateTime.apply({}, args), "plain object"); +assert.throws(TypeError, () => toZonedDateTime.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => toZonedDateTime.apply(Temporal.PlainDate.prototype, args), "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 index ebbafe59ca..07d2419d80 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/until/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/until/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDate(2022, 6, 22)]; + +assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => until.apply(null, args), "null"); +assert.throws(TypeError, () => until.apply(true, args), "true"); +assert.throws(TypeError, () => until.apply("", args), "empty string"); +assert.throws(TypeError, () => until.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => until.apply(1, args), "1"); +assert.throws(TypeError, () => until.apply({}, args), "plain object"); +assert.throws(TypeError, () => until.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => until.apply(Temporal.PlainDate.prototype, args), "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 index e6210e0c51..47ebc9a3a7 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/with/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/with/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ year: 2022 }]; + +assert.throws(TypeError, () => with_.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => with_.apply(null, args), "null"); +assert.throws(TypeError, () => with_.apply(true, args), "true"); +assert.throws(TypeError, () => with_.apply("", args), "empty string"); +assert.throws(TypeError, () => with_.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => with_.apply(1, args), "1"); +assert.throws(TypeError, () => with_.apply({}, args), "plain object"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainDate.prototype, args), "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 index 97f9b34713..964b62ac28 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Calendar("iso8601")]; + +assert.throws(TypeError, () => withCalendar.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => withCalendar.apply(null, args), "null"); +assert.throws(TypeError, () => withCalendar.apply(true, args), "true"); +assert.throws(TypeError, () => withCalendar.apply("", args), "empty string"); +assert.throws(TypeError, () => withCalendar.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => withCalendar.apply(1, args), "1"); +assert.throws(TypeError, () => withCalendar.apply({}, args), "plain object"); +assert.throws(TypeError, () => withCalendar.apply(Temporal.PlainDate, args), "Temporal.PlainDate"); +assert.throws(TypeError, () => withCalendar.apply(Temporal.PlainDate.prototype, args), "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 index 161aa7d25d..d26f8d0692 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/add/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/add/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => add.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => add.apply(null, args), "null"); +assert.throws(TypeError, () => add.apply(true, args), "true"); +assert.throws(TypeError, () => add.apply("", args), "empty string"); +assert.throws(TypeError, () => add.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => add.apply(1, args), "1"); +assert.throws(TypeError, () => add.apply({}, args), "plain object"); +assert.throws(TypeError, () => add.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => add.apply(Temporal.PlainDateTime.prototype, args), "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 index 3b87c808bc..5c150b86a0 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/equals/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDateTime(2022, 6, 22)]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainDateTime.prototype, args), "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 index 9efbaff9c4..28e3b90687 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/round/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/round/branding.js @@ -11,12 +11,14 @@ 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"); +const args = ['hour']; + +assert.throws(TypeError, () => round.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => round.apply(null, args), "null"); +assert.throws(TypeError, () => round.apply(true, args), "true"); +assert.throws(TypeError, () => round.apply("", args), "empty string"); +assert.throws(TypeError, () => round.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => round.apply(1, args), "1"); +assert.throws(TypeError, () => round.apply({}, args), "plain object"); +assert.throws(TypeError, () => round.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => round.apply(Temporal.PlainDateTime.prototype, args), "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 index c516e4d2c5..21313b4df4 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDateTime(2022, 6, 22)]; + +assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => since.apply(null, args), "null"); +assert.throws(TypeError, () => since.apply(true, args), "true"); +assert.throws(TypeError, () => since.apply("", args), "empty string"); +assert.throws(TypeError, () => since.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => since.apply(1, args), "1"); +assert.throws(TypeError, () => since.apply({}, args), "plain object"); +assert.throws(TypeError, () => since.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => since.apply(Temporal.PlainDateTime.prototype, args), "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 index 8c29b1fc8e..7e955dbd29 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => subtract.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => subtract.apply(null, args), "null"); +assert.throws(TypeError, () => subtract.apply(true, args), "true"); +assert.throws(TypeError, () => subtract.apply("", args), "empty string"); +assert.throws(TypeError, () => subtract.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => subtract.apply(1, args), "1"); +assert.throws(TypeError, () => subtract.apply({}, args), "plain object"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainDateTime.prototype, args), "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 index e8f419afce..d58915e726 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.TimeZone("UTC")]; + +assert.throws(TypeError, () => toZonedDateTime.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toZonedDateTime.apply(null, args), "null"); +assert.throws(TypeError, () => toZonedDateTime.apply(true, args), "true"); +assert.throws(TypeError, () => toZonedDateTime.apply("", args), "empty string"); +assert.throws(TypeError, () => toZonedDateTime.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toZonedDateTime.apply(1, args), "1"); +assert.throws(TypeError, () => toZonedDateTime.apply({}, args), "plain object"); +assert.throws(TypeError, () => toZonedDateTime.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => toZonedDateTime.apply(Temporal.PlainDateTime.prototype, args), "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 index d879f44b80..bc1e396341 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDateTime(2022, 6, 22)]; + +assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => until.apply(null, args), "null"); +assert.throws(TypeError, () => until.apply(true, args), "true"); +assert.throws(TypeError, () => until.apply("", args), "empty string"); +assert.throws(TypeError, () => until.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => until.apply(1, args), "1"); +assert.throws(TypeError, () => until.apply({}, args), "plain object"); +assert.throws(TypeError, () => until.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => until.apply(Temporal.PlainDateTime.prototype, args), "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 index 2b9421210c..f6829248a1 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/with/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/with/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ year: 2022 }]; + +assert.throws(TypeError, () => with_.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => with_.apply(null, args), "null"); +assert.throws(TypeError, () => with_.apply(true, args), "true"); +assert.throws(TypeError, () => with_.apply("", args), "empty string"); +assert.throws(TypeError, () => with_.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => with_.apply(1, args), "1"); +assert.throws(TypeError, () => with_.apply({}, args), "plain object"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainDateTime.prototype, args), "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 index 6c001fb6ef..911f96a77f 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Calendar("iso8601")]; + +assert.throws(TypeError, () => withCalendar.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => withCalendar.apply(null, args), "null"); +assert.throws(TypeError, () => withCalendar.apply(true, args), "true"); +assert.throws(TypeError, () => withCalendar.apply("", args), "empty string"); +assert.throws(TypeError, () => withCalendar.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => withCalendar.apply(1, args), "1"); +assert.throws(TypeError, () => withCalendar.apply({}, args), "plain object"); +assert.throws(TypeError, () => withCalendar.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => withCalendar.apply(Temporal.PlainDateTime.prototype, args), "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 index e4d5ef4341..13067652f8 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDate(2022, 6, 22)]; + +assert.throws(TypeError, () => withPlainDate.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => withPlainDate.apply(null, args), "null"); +assert.throws(TypeError, () => withPlainDate.apply(true, args), "true"); +assert.throws(TypeError, () => withPlainDate.apply("", args), "empty string"); +assert.throws(TypeError, () => withPlainDate.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => withPlainDate.apply(1, args), "1"); +assert.throws(TypeError, () => withPlainDate.apply({}, args), "plain object"); +assert.throws(TypeError, () => withPlainDate.apply(Temporal.PlainDateTime, args), "Temporal.PlainDateTime"); +assert.throws(TypeError, () => withPlainDate.apply(Temporal.PlainDateTime.prototype, args), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js index 88bb5ad25a..39e0185d95 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainMonthDay(5, 2)]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainMonthDay, args), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainMonthDay.prototype, args), "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 index eb321664b3..36961442b0 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/branding.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ year: 2022 }]; + +assert.throws(TypeError, () => toPlainDate.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toPlainDate.apply(null, args), "null"); +assert.throws(TypeError, () => toPlainDate.apply(true, args), "true"); +assert.throws(TypeError, () => toPlainDate.apply("", args), "empty string"); +assert.throws(TypeError, () => toPlainDate.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toPlainDate.apply(1, args), "1"); +assert.throws(TypeError, () => toPlainDate.apply({}, args), "plain object"); +assert.throws(TypeError, () => toPlainDate.apply(Temporal.PlainMonthDay, args), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => toPlainDate.apply(Temporal.PlainMonthDay.prototype, args), "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 index e178fbad23..e8f69fdaf3 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/with/branding.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/with/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ year: 2022, month: 12 }]; + +assert.throws(TypeError, () => with_.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => with_.apply(null, args), "null"); +assert.throws(TypeError, () => with_.apply(true, args), "true"); +assert.throws(TypeError, () => with_.apply("", args), "empty string"); +assert.throws(TypeError, () => with_.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => with_.apply(1, args), "1"); +assert.throws(TypeError, () => with_.apply({}, args), "plain object"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainMonthDay, args), "Temporal.PlainMonthDay"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainMonthDay.prototype, args), "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 index 681834574b..6139b87d8a 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/add/branding.js +++ b/test/built-ins/Temporal/PlainTime/prototype/add/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(0, 0, 0, 0, 5)]; + +assert.throws(TypeError, () => add.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => add.apply(null, args), "null"); +assert.throws(TypeError, () => add.apply(true, args), "true"); +assert.throws(TypeError, () => add.apply("", args), "empty string"); +assert.throws(TypeError, () => add.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => add.apply(1, args), "1"); +assert.throws(TypeError, () => add.apply({}, args), "plain object"); +assert.throws(TypeError, () => add.apply(Temporal.PlainTime, args), "Temporal.PlainTime"); +assert.throws(TypeError, () => add.apply(Temporal.PlainTime.prototype, args), "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 index 350a74dd43..82e418335c 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/equals/branding.js +++ b/test/built-ins/Temporal/PlainTime/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainTime(12)]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainTime, args), "Temporal.PlainTime"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainTime.prototype, args), "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 index 632ee5c8b3..4232b61235 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/since/branding.js +++ b/test/built-ins/Temporal/PlainTime/prototype/since/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainTime(12)]; + +assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => since.apply(null, args), "null"); +assert.throws(TypeError, () => since.apply(true, args), "true"); +assert.throws(TypeError, () => since.apply("", args), "empty string"); +assert.throws(TypeError, () => since.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => since.apply(1, args), "1"); +assert.throws(TypeError, () => since.apply({}, args), "plain object"); +assert.throws(TypeError, () => since.apply(Temporal.PlainTime, args), "Temporal.PlainTime"); +assert.throws(TypeError, () => since.apply(Temporal.PlainTime.prototype, args), "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 index 503d158caa..ff88f4d12a 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/subtract/branding.js +++ b/test/built-ins/Temporal/PlainTime/prototype/subtract/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(0, 0, 0, 0, 5)]; + +assert.throws(TypeError, () => subtract.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => subtract.apply(null, args), "null"); +assert.throws(TypeError, () => subtract.apply(true, args), "true"); +assert.throws(TypeError, () => subtract.apply("", args), "empty string"); +assert.throws(TypeError, () => subtract.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => subtract.apply(1, args), "1"); +assert.throws(TypeError, () => subtract.apply({}, args), "plain object"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainTime, args), "Temporal.PlainTime"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainTime.prototype, args), "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 index 16a5cd64a0..55c91392b5 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/branding.js +++ b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDate(2022, 6, 22)]; + +assert.throws(TypeError, () => toPlainDateTime.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toPlainDateTime.apply(null, args), "null"); +assert.throws(TypeError, () => toPlainDateTime.apply(true, args), "true"); +assert.throws(TypeError, () => toPlainDateTime.apply("", args), "empty string"); +assert.throws(TypeError, () => toPlainDateTime.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toPlainDateTime.apply(1, args), "1"); +assert.throws(TypeError, () => toPlainDateTime.apply({}, args), "plain object"); +assert.throws(TypeError, () => toPlainDateTime.apply(Temporal.PlainTime, args), "Temporal.PlainTime"); +assert.throws(TypeError, () => toPlainDateTime.apply(Temporal.PlainTime.prototype, args), "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 index 44234d5887..960d78740b 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/until/branding.js +++ b/test/built-ins/Temporal/PlainTime/prototype/until/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainTime(12)]; + +assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => until.apply(null, args), "null"); +assert.throws(TypeError, () => until.apply(true, args), "true"); +assert.throws(TypeError, () => until.apply("", args), "empty string"); +assert.throws(TypeError, () => until.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => until.apply(1, args), "1"); +assert.throws(TypeError, () => until.apply({}, args), "plain object"); +assert.throws(TypeError, () => until.apply(Temporal.PlainTime, args), "Temporal.PlainTime"); +assert.throws(TypeError, () => until.apply(Temporal.PlainTime.prototype, args), "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 index e7b67165b7..0332dcf1c2 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/add/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/add/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => add.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => add.apply(null, args), "null"); +assert.throws(TypeError, () => add.apply(true, args), "true"); +assert.throws(TypeError, () => add.apply("", args), "empty string"); +assert.throws(TypeError, () => add.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => add.apply(1, args), "1"); +assert.throws(TypeError, () => add.apply({}, args), "plain object"); +assert.throws(TypeError, () => add.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => add.apply(Temporal.PlainYearMonth.prototype, args), "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 index b180108229..81b62546b8 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainYearMonth(2022, 6)]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => equals.apply(Temporal.PlainYearMonth.prototype, args), "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 index f7327b4124..473029089d 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainYearMonth(2022, 6)]; + +assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => since.apply(null, args), "null"); +assert.throws(TypeError, () => since.apply(true, args), "true"); +assert.throws(TypeError, () => since.apply("", args), "empty string"); +assert.throws(TypeError, () => since.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => since.apply(1, args), "1"); +assert.throws(TypeError, () => since.apply({}, args), "plain object"); +assert.throws(TypeError, () => since.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => since.apply(Temporal.PlainYearMonth.prototype, args), "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 index cc60497b07..0de3d153b7 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => subtract.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => subtract.apply(null, args), "null"); +assert.throws(TypeError, () => subtract.apply(true, args), "true"); +assert.throws(TypeError, () => subtract.apply("", args), "empty string"); +assert.throws(TypeError, () => subtract.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => subtract.apply(1, args), "1"); +assert.throws(TypeError, () => subtract.apply({}, args), "plain object"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => subtract.apply(Temporal.PlainYearMonth.prototype, args), "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 index 67d16016cb..87aa00bb56 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ day: 7 }]; + +assert.throws(TypeError, () => toPlainDate.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => toPlainDate.apply(null, args), "null"); +assert.throws(TypeError, () => toPlainDate.apply(true, args), "true"); +assert.throws(TypeError, () => toPlainDate.apply("", args), "empty string"); +assert.throws(TypeError, () => toPlainDate.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => toPlainDate.apply(1, args), "1"); +assert.throws(TypeError, () => toPlainDate.apply({}, args), "plain object"); +assert.throws(TypeError, () => toPlainDate.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => toPlainDate.apply(Temporal.PlainYearMonth.prototype, args), "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 index 4487e20d8d..09ed4dffa3 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainYearMonth(2022, 6)]; + +assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => until.apply(null, args), "null"); +assert.throws(TypeError, () => until.apply(true, args), "true"); +assert.throws(TypeError, () => until.apply("", args), "empty string"); +assert.throws(TypeError, () => until.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => until.apply(1, args), "1"); +assert.throws(TypeError, () => until.apply({}, args), "plain object"); +assert.throws(TypeError, () => until.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => until.apply(Temporal.PlainYearMonth.prototype, args), "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 index 131d9f8c2e..f0c085828c 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/with/branding.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/with/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ year: 2022 }]; + +assert.throws(TypeError, () => with_.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => with_.apply(null, args), "null"); +assert.throws(TypeError, () => with_.apply(true, args), "true"); +assert.throws(TypeError, () => with_.apply("", args), "empty string"); +assert.throws(TypeError, () => with_.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => with_.apply(1, args), "1"); +assert.throws(TypeError, () => with_.apply({}, args), "plain object"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainYearMonth, args), "Temporal.PlainYearMonth"); +assert.throws(TypeError, () => with_.apply(Temporal.PlainYearMonth.prototype, args), "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 index b8c570cadc..0a95f4c43b 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/branding.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDateTime(2022, 6, 22)]; + +assert.throws(TypeError, () => getInstantFor.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => getInstantFor.apply(null, args), "null"); +assert.throws(TypeError, () => getInstantFor.apply(true, args), "true"); +assert.throws(TypeError, () => getInstantFor.apply("", args), "empty string"); +assert.throws(TypeError, () => getInstantFor.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => getInstantFor.apply(1, args), "1"); +assert.throws(TypeError, () => getInstantFor.apply({}, args), "plain object"); +assert.throws(TypeError, () => getInstantFor.apply(Temporal.TimeZone, args), "Temporal.TimeZone"); +assert.throws(TypeError, () => getInstantFor.apply(Temporal.TimeZone.prototype, args), "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 index 6a53945fab..9b629ee6e5 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getNextTransition/branding.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getNextTransition/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Instant(0n)]; + +assert.throws(TypeError, () => getNextTransition.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => getNextTransition.apply(null, args), "null"); +assert.throws(TypeError, () => getNextTransition.apply(true, args), "true"); +assert.throws(TypeError, () => getNextTransition.apply("", args), "empty string"); +assert.throws(TypeError, () => getNextTransition.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => getNextTransition.apply(1, args), "1"); +assert.throws(TypeError, () => getNextTransition.apply({}, args), "plain object"); +assert.throws(TypeError, () => getNextTransition.apply(Temporal.TimeZone, args), "Temporal.TimeZone"); +assert.throws(TypeError, () => getNextTransition.apply(Temporal.TimeZone.prototype, args), "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 index a63ebda0f7..6071b04848 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/branding.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/branding.js @@ -11,12 +11,14 @@ const getOffsetNanosecondsFor = Temporal.TimeZone.prototype.getOffsetNanoseconds 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"); +const args = [new Temporal.Instant(0n)]; + +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(null, args), "null"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(true, args), "true"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply("", args), "empty string"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(1, args), "1"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply({}, args), "plain object"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(Temporal.TimeZone, args), "Temporal.TimeZone"); +assert.throws(TypeError, () => getOffsetNanosecondsFor.apply(Temporal.TimeZone.prototype, args), "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 index 0fc6c49806..1017cda02c 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/branding.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Instant(0n)]; + +assert.throws(TypeError, () => getOffsetStringFor.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => getOffsetStringFor.apply(null, args), "null"); +assert.throws(TypeError, () => getOffsetStringFor.apply(true, args), "true"); +assert.throws(TypeError, () => getOffsetStringFor.apply("", args), "empty string"); +assert.throws(TypeError, () => getOffsetStringFor.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => getOffsetStringFor.apply(1, args), "1"); +assert.throws(TypeError, () => getOffsetStringFor.apply({}, args), "plain object"); +assert.throws(TypeError, () => getOffsetStringFor.apply(Temporal.TimeZone, args), "Temporal.TimeZone"); +assert.throws(TypeError, () => getOffsetStringFor.apply(Temporal.TimeZone.prototype, args), "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 index 431d3c520a..8506d52aee 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/branding.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/branding.js @@ -11,12 +11,14 @@ const getPossibleInstantsFor = Temporal.TimeZone.prototype.getPossibleInstantsFo 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"); +const args = [new Temporal.PlainDateTime(2022, 6, 22)]; + +assert.throws(TypeError, () => getPossibleInstantsFor.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply(null, args), "null"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply(true, args), "true"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply("", args), "empty string"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply(1, args), "1"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply({}, args), "plain object"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply(Temporal.TimeZone, args), "Temporal.TimeZone"); +assert.throws(TypeError, () => getPossibleInstantsFor.apply(Temporal.TimeZone.prototype, args), "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 index eaa3530e46..75e4164e4d 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/branding.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Instant(0n)]; + +assert.throws(TypeError, () => getPreviousTransition.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => getPreviousTransition.apply(null, args), "null"); +assert.throws(TypeError, () => getPreviousTransition.apply(true, args), "true"); +assert.throws(TypeError, () => getPreviousTransition.apply("", args), "empty string"); +assert.throws(TypeError, () => getPreviousTransition.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => getPreviousTransition.apply(1, args), "1"); +assert.throws(TypeError, () => getPreviousTransition.apply({}, args), "plain object"); +assert.throws(TypeError, () => getPreviousTransition.apply(Temporal.TimeZone, args), "Temporal.TimeZone"); +assert.throws(TypeError, () => getPreviousTransition.apply(Temporal.TimeZone.prototype, args), "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 index c9dc587495..1f7ce7de0f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/add/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/add/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => add.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => add.apply(null, args), "null"); +assert.throws(TypeError, () => add.apply(true, args), "true"); +assert.throws(TypeError, () => add.apply("", args), "empty string"); +assert.throws(TypeError, () => add.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => add.apply(1, args), "1"); +assert.throws(TypeError, () => add.apply({}, args), "plain object"); +assert.throws(TypeError, () => add.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => add.apply(Temporal.ZonedDateTime.prototype, args), "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 index 05705c4d7c..3d135a3d38 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.ZonedDateTime(123456n, new Temporal.TimeZone("UTC"))]; + +assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => equals.apply(null, args), "null"); +assert.throws(TypeError, () => equals.apply(true, args), "true"); +assert.throws(TypeError, () => equals.apply("", args), "empty string"); +assert.throws(TypeError, () => equals.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => equals.apply(1, args), "1"); +assert.throws(TypeError, () => equals.apply({}, args), "plain object"); +assert.throws(TypeError, () => equals.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => equals.apply(Temporal.ZonedDateTime.prototype, args), "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 index f0b708e841..2aaf37a57a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/round/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/round/branding.js @@ -11,12 +11,14 @@ 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"); +const args = ["hour"]; + +assert.throws(TypeError, () => round.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => round.apply(null, args), "null"); +assert.throws(TypeError, () => round.apply(true, args), "true"); +assert.throws(TypeError, () => round.apply("", args), "empty string"); +assert.throws(TypeError, () => round.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => round.apply(1, args), "1"); +assert.throws(TypeError, () => round.apply({}, args), "plain object"); +assert.throws(TypeError, () => round.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => round.apply(Temporal.ZonedDateTime.prototype, args), "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 index 2676e647af..5695e13f2e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.ZonedDateTime(123456n, new Temporal.TimeZone("UTC"))]; + +assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => since.apply(null, args), "null"); +assert.throws(TypeError, () => since.apply(true, args), "true"); +assert.throws(TypeError, () => since.apply("", args), "empty string"); +assert.throws(TypeError, () => since.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => since.apply(1, args), "1"); +assert.throws(TypeError, () => since.apply({}, args), "plain object"); +assert.throws(TypeError, () => since.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => since.apply(Temporal.ZonedDateTime.prototype, args), "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 index 0dcb416836..226d5d0c47 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Duration(5)]; + +assert.throws(TypeError, () => subtract.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => subtract.apply(null, args), "null"); +assert.throws(TypeError, () => subtract.apply(true, args), "true"); +assert.throws(TypeError, () => subtract.apply("", args), "empty string"); +assert.throws(TypeError, () => subtract.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => subtract.apply(1, args), "1"); +assert.throws(TypeError, () => subtract.apply({}, args), "plain object"); +assert.throws(TypeError, () => subtract.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => subtract.apply(Temporal.ZonedDateTime.prototype, args), "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 index 18210ae365..a84b29e76b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.ZonedDateTime(123456n, new Temporal.TimeZone("UTC"))]; + +assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => until.apply(null, args), "null"); +assert.throws(TypeError, () => until.apply(true, args), "true"); +assert.throws(TypeError, () => until.apply("", args), "empty string"); +assert.throws(TypeError, () => until.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => until.apply(1, args), "1"); +assert.throws(TypeError, () => until.apply({}, args), "plain object"); +assert.throws(TypeError, () => until.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => until.apply(Temporal.ZonedDateTime.prototype, args), "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 index 2d9fa03c67..70be8c48f5 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [{ year: 2022 }]; + +assert.throws(TypeError, () => with_.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => with_.apply(null, args), "null"); +assert.throws(TypeError, () => with_.apply(true, args), "true"); +assert.throws(TypeError, () => with_.apply("", args), "empty string"); +assert.throws(TypeError, () => with_.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => with_.apply(1, args), "1"); +assert.throws(TypeError, () => with_.apply({}, args), "plain object"); +assert.throws(TypeError, () => with_.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => with_.apply(Temporal.ZonedDateTime.prototype, args), "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 index 4958c2884c..1533200c97 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.Calendar("iso8601")]; + +assert.throws(TypeError, () => withCalendar.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => withCalendar.apply(null, args), "null"); +assert.throws(TypeError, () => withCalendar.apply(true, args), "true"); +assert.throws(TypeError, () => withCalendar.apply("", args), "empty string"); +assert.throws(TypeError, () => withCalendar.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => withCalendar.apply(1, args), "1"); +assert.throws(TypeError, () => withCalendar.apply({}, args), "plain object"); +assert.throws(TypeError, () => withCalendar.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withCalendar.apply(Temporal.ZonedDateTime.prototype, args), "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 index 5d9df4cbfb..f4ff7dc39e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.PlainDate(2022, 6, 22)]; + +assert.throws(TypeError, () => withPlainDate.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => withPlainDate.apply(null, args), "null"); +assert.throws(TypeError, () => withPlainDate.apply(true, args), "true"); +assert.throws(TypeError, () => withPlainDate.apply("", args), "empty string"); +assert.throws(TypeError, () => withPlainDate.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => withPlainDate.apply(1, args), "1"); +assert.throws(TypeError, () => withPlainDate.apply({}, args), "plain object"); +assert.throws(TypeError, () => withPlainDate.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withPlainDate.apply(Temporal.ZonedDateTime.prototype, args), "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 index 15c0b3379f..feecfe91b3 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js @@ -11,12 +11,14 @@ 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"); +const args = [new Temporal.TimeZone("UTC")]; + +assert.throws(TypeError, () => withTimeZone.apply(undefined, args), "undefined"); +assert.throws(TypeError, () => withTimeZone.apply(null, args), "null"); +assert.throws(TypeError, () => withTimeZone.apply(true, args), "true"); +assert.throws(TypeError, () => withTimeZone.apply("", args), "empty string"); +assert.throws(TypeError, () => withTimeZone.apply(Symbol(), args), "symbol"); +assert.throws(TypeError, () => withTimeZone.apply(1, args), "1"); +assert.throws(TypeError, () => withTimeZone.apply({}, args), "plain object"); +assert.throws(TypeError, () => withTimeZone.apply(Temporal.ZonedDateTime, args), "Temporal.ZonedDateTime"); +assert.throws(TypeError, () => withTimeZone.apply(Temporal.ZonedDateTime.prototype, args), "Temporal.ZonedDateTime.prototype");