Temporal: Make branding tests more robust.

This commit is contained in:
Ms2ger 2022-06-20 11:44:22 +02:00
parent 080e893e21
commit 9762bc991f
63 changed files with 693 additions and 567 deletions

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");