summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/temporal
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/temporal')
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-constructor.js9
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-date-from-fields.js127
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-date-until.js4
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-fields.js53
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-from.js2
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-merge-fields.js15
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-month-day-from-fields.js153
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-month.js3
-rw-r--r--deps/v8/test/mjsunit/temporal/calendar-year-month-from-fields.js64
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-abs.js6
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-add.js54
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-constructor.js84
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-from.js66
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-negated.js12
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-valueOf.js3
-rw-r--r--deps/v8/test/mjsunit/temporal/duration-with.js90
-rw-r--r--deps/v8/test/mjsunit/temporal/plain-date-add.js2
-rw-r--r--deps/v8/test/mjsunit/temporal/plain-date-time-from.js2
-rw-r--r--deps/v8/test/mjsunit/temporal/temporal-helpers.js24
-rw-r--r--deps/v8/test/mjsunit/temporal/time-zone-constructor.js12
20 files changed, 341 insertions, 444 deletions
diff --git a/deps/v8/test/mjsunit/temporal/calendar-constructor.js b/deps/v8/test/mjsunit/temporal/calendar-constructor.js
index fcdcbe4f2c..d0bf81f56c 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-constructor.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-constructor.js
@@ -6,14 +6,11 @@
// https://tc39.es/proposal-temporal/#sec-temporal.calendar
// 1. If NewTarget is undefined, then
// a. Throw a TypeError exception.
-assertThrows(() => Temporal.Calendar("iso8601"), TypeError,
- "Constructor Temporal.Calendar requires 'new'");
+assertThrows(() => Temporal.Calendar("iso8601"), TypeError);
-assertThrows(() => new Temporal.Calendar(), RangeError,
- "Invalid calendar specified: undefined");
+assertThrows(() => new Temporal.Calendar(), RangeError);
// Wrong case
-assertThrows(() => new Temporal.Calendar("ISO8601"), RangeError,
- "Invalid calendar specified: ISO8601");
+assertThrows(() => new Temporal.Calendar("ISO8601"), RangeError);
assertEquals("iso8601", (new Temporal.Calendar("iso8601")).id)
diff --git a/deps/v8/test/mjsunit/temporal/calendar-date-from-fields.js b/deps/v8/test/mjsunit/temporal/calendar-date-from-fields.js
index f272932b43..e8cdf4ecb1 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-date-from-fields.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-date-from-fields.js
@@ -8,110 +8,100 @@ let cal = new Temporal.Calendar("iso8601")
// Check throw for first arg
assertThrows(() => cal.dateFromFields(),
- TypeError,
- "Temporal.Calendar.prototype.dateFromFields called on non-object");
+ TypeError);
[undefined, true, false, 123, 456n, Symbol(), "string",
123.456, NaN, null].forEach(
function(fields) {
- assertThrows(() => cal.dateFromFields(fields), TypeError,
- "Temporal.Calendar.prototype.dateFromFields called on non-object");
- assertThrows(() => cal.dateFromFields(fields, undefined), TypeError,
- "Temporal.Calendar.prototype.dateFromFields called on non-object");
+ assertThrows(() => cal.dateFromFields(fields), TypeError);
+ assertThrows(() => cal.dateFromFields(fields, undefined), TypeError);
assertThrows(() => cal.dateFromFields(fields, {overflow: "constrain"}),
- TypeError,
- "Temporal.Calendar.prototype.dateFromFields called on non-object");
+ TypeError);
assertThrows(() => cal.dateFromFields(fields, {overflow: "reject"}),
- TypeError,
- "Temporal.Calendar.prototype.dateFromFields called on non-object");
+ TypeError);
});
-assertThrows(() => cal.dateFromFields({month: 1, day: 17}),
- TypeError, "invalid_argument");
-assertThrows(() => cal.dateFromFields({year: 2021, day: 17}),
- TypeError, "invalid_argument");
-assertThrows(() => cal.dateFromFields({year: 2021, month: 12}),
- TypeError, "invalid_argument");
+assertThrows(() => cal.dateFromFields({month: 1, day: 17}), TypeError);
+assertThrows(() => cal.dateFromFields({year: 2021, day: 17}), TypeError);
+assertThrows(() => cal.dateFromFields({year: 2021, month: 12}), TypeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "m1", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "M1", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "m01", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 12, monthCode: "M11",
- day: 17}), RangeError, "monthCode value is out of range.");
+ day: 17}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "M00", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "M19", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "M99", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, monthCode: "M13", day: 17}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: -1, day: 17}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: -Infinity, day: 17}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 7, day: -17}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 7, day: -Infinity}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 12, day: 0},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 12, day: 32},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 1, day: 32},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 2, day: 29},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 6, day: 31},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 9, day: 31},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 0, day: 5},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields({year: 2021, month: 13, day: 5},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M12", day: 0}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M12", day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M01", day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M02", day: 29}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M06", day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M09", day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M00", day: 5}, {overflow: "reject"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields(
{year: 2021, monthCode: "M13", day: 5}, {overflow: "reject"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 12, day: 0}), RangeError, "Invalid time value");
+ {year: 2021, month: 12, day: 0}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 0, day: 3}), RangeError, "Invalid time value");
+ {year: 2021, month: 0, day: 3}), RangeError);
// Check throw for the second arg
assertThrows(() => cal.dateFromFields(
{year: 2021, month: 7, day: 13}, {overflow: "invalid"}),
- RangeError,
- "Value invalid out of range for Temporal.Calendar.prototype.dateFromFields"
- + " options property overflow");
+ RangeError);
assertEquals("2021-07-15",
cal.dateFromFields({year: 2021, month: 7, day: 15}).toJSON());
@@ -180,41 +170,28 @@ assertEquals("2021-12-31",
cal.dateFromFields({year: 2021, monthCode: "M12", day: 500}).toJSON());
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 1, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 1, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 2, day: 29}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 2, day: 29}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 3, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 3, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 4, day: 31}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 4, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 5, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 5, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 6, day: 31}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 6, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 7, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 7, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 8, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 8, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 9, day: 31}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 9, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 10, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 10, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 11, day: 31}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 11, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 12, day: 32}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 12, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.dateFromFields(
- {year: 2021, month: 13, day: 5}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 13, day: 5}, {overflow: "reject"}), RangeError);
diff --git a/deps/v8/test/mjsunit/temporal/calendar-date-until.js b/deps/v8/test/mjsunit/temporal/calendar-date-until.js
index a403646118..8968dbe5a1 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-date-until.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-date-until.js
@@ -10,9 +10,7 @@ let cal = new Temporal.Calendar("iso8601");
[ "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" ]
.forEach(function(largestUnit) {
assertThrows(() => cal.dateUntil("2021-07-16", "2021-07-17",
- {largestUnit}), RangeError,
- "Invalid unit argument for Temporal.Calendar.prototype.dateUntil() "+
- "'largestUnit'");
+ {largestUnit}), RangeError);
});
assertEquals("PT0S", cal.dateUntil("2021-07-16", "2021-07-16").toJSON());
diff --git a/deps/v8/test/mjsunit/temporal/calendar-fields.js b/deps/v8/test/mjsunit/temporal/calendar-fields.js
index cf10d9537e..e7c8db32c4 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-fields.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-fields.js
@@ -8,16 +8,51 @@ let cal = new Temporal.Calendar("iso8601")
assertEquals("iso8601", cal.id)
-const fields = {
+let i = 1;
+const repeated = {
*[Symbol.iterator]() {
- let i = 0;
- while (i++ < 1000) {
- yield "year";
- }
+ yield "year";
+ i++;
+ yield "year";
+ i++;
}
}
-let expected = Array.from(fields);
-// For now, we only input it as array
-let inpiut = expected;
-assertArrayEquals(expected, cal.fields(expected));
+assertThrows(() => cal.fields(repeated), RangeError);
+assertEquals(2, i);
+let repeatedArray = Array.from(repeated);
+assertThrows(() => cal.fields(repeatedArray), RangeError);
+
+const week = {
+ *[Symbol.iterator]() {
+ yield "week";
+ }
+}
+
+assertThrows(() => cal.fields(week), RangeError);
+assertThrows(() => cal.fields(['week']), RangeError);
+assertThrows(() => cal.fields(new Set(['week'])), RangeError);
+
+const allValid = {
+ *[Symbol.iterator]() {
+ yield "nanosecond";
+ yield "microsecond";
+ yield "millisecond";
+ yield "second";
+ yield "minute";
+ yield "hour";
+ yield "day";
+ yield "monthCode";
+ yield "month";
+ yield "year";
+ }
+}
+
+let allValidArray = Array.from(allValid);
+let allValidSet = new Set(allValid);
+assertArrayEquals(allValidArray, cal.fields(allValid));
+assertArrayEquals(allValidArray, cal.fields(allValidArray));
+assertArrayEquals(allValidArray, cal.fields(allValidSet));
+
+// cannot just return the same array
+assertTrue(allValidArray != cal.fields(allValidArray));
diff --git a/deps/v8/test/mjsunit/temporal/calendar-from.js b/deps/v8/test/mjsunit/temporal/calendar-from.js
index ab63c84ac2..2c8b83021c 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-from.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-from.js
@@ -6,8 +6,6 @@
// https://tc39.es/proposal-temporal/#sec-temporal.calendar.from
// 1. If NewTarget is undefined, then
// a. Throw a TypeError exception.
-//assertThrows(() => Temporal.Calendar.from("invalid"), TypeError,
-// "Constructor Temporal.Calendar requires 'new'");
assertEquals("iso8601",
(Temporal.Calendar.from("iso8601")).id);
diff --git a/deps/v8/test/mjsunit/temporal/calendar-merge-fields.js b/deps/v8/test/mjsunit/temporal/calendar-merge-fields.js
index 82a846772f..7e7a96a2de 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-merge-fields.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-merge-fields.js
@@ -7,16 +7,11 @@
let cal = new Temporal.Calendar("iso8601")
// Test throwing
-assertThrows(() => cal.mergeFields(), TypeError,
- "Cannot convert undefined or null to object");
-assertThrows(() => cal.mergeFields(undefined, {}), TypeError,
- "Cannot convert undefined or null to object");
-assertThrows(() => cal.mergeFields(null, {}), TypeError,
- "Cannot convert undefined or null to object");
-assertThrows(() => cal.mergeFields({}, undefined), TypeError,
- "Cannot convert undefined or null to object");
-assertThrows(() => cal.mergeFields({}, null), TypeError,
- "Cannot convert undefined or null to object");
+assertThrows(() => cal.mergeFields(), TypeError);
+assertThrows(() => cal.mergeFields(undefined, {}), TypeError);
+assertThrows(() => cal.mergeFields(null, {}), TypeError);
+assertThrows(() => cal.mergeFields({}, undefined), TypeError);
+assertThrows(() => cal.mergeFields({}, null), TypeError);
// Test String, number, true, false, NaN, BigInt, Symbol types
// pending on https://github.com/tc39/proposal-temporal/issues/1647
diff --git a/deps/v8/test/mjsunit/temporal/calendar-month-day-from-fields.js b/deps/v8/test/mjsunit/temporal/calendar-month-day-from-fields.js
index 1ff45c6117..41332fa1b1 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-month-day-from-fields.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-month-day-from-fields.js
@@ -7,127 +7,89 @@
let cal = new Temporal.Calendar("iso8601")
// Check throw for first arg
-let nonObjMsg =
- "Temporal.Calendar.prototype.monthDayFromFields called on non-object";
-assertThrows(() => cal.monthDayFromFields(), TypeError,
- "Temporal.Calendar.prototype.monthDayFromFields called on non-object");
+assertThrows(() => cal.monthDayFromFields(), TypeError);
[undefined, true, false, 123, 456n, Symbol(), "string"].forEach(
function(fields) {
- assertThrows(() => cal.monthDayFromFields(fields), TypeError,
- nonObjMsg);
- assertThrows(() => cal.monthDayFromFields(fields, undefined), TypeError,
- nonObjMsg);
+ assertThrows(() => cal.monthDayFromFields(fields), TypeError);
+ assertThrows(() => cal.monthDayFromFields(fields, undefined), TypeError);
assertThrows(() => cal.monthDayFromFields(fields,
- {overflow: "constrain"}), TypeError, nonObjMsg);
+ {overflow: "constrain"}), TypeError);
assertThrows(() => cal.monthDayFromFields(fields, {overflow: "reject"}),
- TypeError, nonObjMsg);
+ TypeError);
});
-assertThrows(() => cal.monthDayFromFields({month: 1, day: 17}),
- TypeError, "invalid_argument");
-assertThrows(() => cal.monthDayFromFields({year: 2021, day: 17}),
- TypeError, "invalid_argument");
-assertThrows(() => cal.monthDayFromFields({year: 2021, month: 12}),
- TypeError, "invalid_argument");
+assertThrows(() => cal.monthDayFromFields({month: 1, day: 17}), TypeError);
+assertThrows(() => cal.monthDayFromFields({year: 2021, day: 17}), TypeError);
+assertThrows(() => cal.monthDayFromFields({year: 2021, month: 12}), TypeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "m1", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "m1", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M1", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M1", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "m01", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "m01", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 12, monthCode: "M11", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, month: 12, monthCode: "M11", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M00", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M00", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M19", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M19", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M99", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M99", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M13", day: 17}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M13", day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: -1, day: 17}),
- RangeError, "Invalid time value");
+ {year: 2021, month: -1, day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: -Infinity, day: 17}),
- RangeError, "Invalid time value");
+ {year: 2021, month: -Infinity, day: 17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 7, day: -17}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 7, day: -17}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 7, day: -Infinity}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 7, day: -Infinity}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 12, day: 0}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 12, day: 0}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 12, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 12, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 1, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 1, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 2, day: 29}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 2, day: 29}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 6, day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 6, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 9, day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 9, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 0, day: 5}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 0, day: 5}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 13, day: 5}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 13, day: 5}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M12", day: 0}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, monthCode: "M12", day: 0}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M12", day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, monthCode: "M12", day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M01", day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, monthCode: "M01", day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M06", day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, monthCode: "M06", day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M09", day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, monthCode: "M09", day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M00", day: 5}, {overflow: "reject"}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M00", day: 5}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, monthCode: "M13", day: 5}, {overflow: "reject"}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M13", day: 5}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 12, day: 0}), RangeError, "Invalid time value");
+ {year: 2021, month: 12, day: 0}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 0, day: 3}), RangeError, "Invalid time value");
+ {year: 2021, month: 0, day: 3}), RangeError);
// Check throw for the second arg
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 7, day: 13}, {overflow: "invalid"}),
- RangeError,
- "Value invalid out of range for Temporal.Calendar.prototype." +
- "monthDayFromFields options property overflow");
+ {year: 2021, month: 7, day: 13}, {overflow: "invalid"}), RangeError);
assertEquals("07-15", cal.monthDayFromFields(
{year: 2021, month: 7, day: 15}).toJSON());
@@ -198,41 +160,28 @@ assertEquals("12-31", cal.monthDayFromFields(
{year: 2021, monthCode: "M12", day: 500}).toJSON());
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 1, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 1, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 2, day: 29}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 2, day: 29}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 3, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 3, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 4, day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 4, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 5, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 5, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 6, day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 6, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 7, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 7, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 8, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 8, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 9, day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 9, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 10, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 10, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 11, day: 31}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 11, day: 31}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 12, day: 32}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 12, day: 32}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.monthDayFromFields(
- {year: 2021, month: 13, day: 5}, {overflow: "reject"}),
- RangeError, "Invalid time value");
+ {year: 2021, month: 13, day: 5}, {overflow: "reject"}), RangeError);
diff --git a/deps/v8/test/mjsunit/temporal/calendar-month.js b/deps/v8/test/mjsunit/temporal/calendar-month.js
index 02b0fe644d..53bfb5c0c9 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-month.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-month.js
@@ -10,8 +10,7 @@ assertEquals(7, cal.month(new Temporal.PlainDate(2021, 7, 15)));
assertEquals(8, cal.month(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13)));
assertEquals(6, cal.month(new Temporal.PlainYearMonth(1999, 6)));
assertEquals(3, cal.month("2019-03-15"));
-assertThrows(() => cal.month(new Temporal.PlainMonthDay(3, 16)), TypeError,
- "invalid_argument");
+assertThrows(() => cal.month(new Temporal.PlainMonthDay(3, 16)), TypeError);
// TODO Test the following later.
//assertEquals(1, cal.month(new Temporal.ZonedDateTime(86400n * 366n * 50n,
diff --git a/deps/v8/test/mjsunit/temporal/calendar-year-month-from-fields.js b/deps/v8/test/mjsunit/temporal/calendar-year-month-from-fields.js
index 8124546339..b5e87826ae 100644
--- a/deps/v8/test/mjsunit/temporal/calendar-year-month-from-fields.js
+++ b/deps/v8/test/mjsunit/temporal/calendar-year-month-from-fields.js
@@ -6,73 +6,61 @@
// https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.yearmonthfromfields
let cal = new Temporal.Calendar("iso8601")
-let nonObjMsg =
- "Temporal.Calendar.prototype.yearMonthFromFields called on non-object");
// Check throw for first arg
assertThrows(() => cal.yearMonthFromFields(),
- TypeError, nonObjMsg);
+ TypeError);
[undefined, true, false, 123, 456n, Symbol(), "string"].forEach(
function(fields) {
- assertThrows(() => cal.yearMonthFromFields(fields), TypeError, nonObjMsg);
- assertThrows(() => cal.yearMonthFromFields(fields, undefined),
- TypeError, nonObjMsg);
+ assertThrows(() => cal.yearMonthFromFields(fields), TypeError);
+ assertThrows(() => cal.yearMonthFromFields(fields, undefined), TypeError);
assertThrows(() => cal.yearMonthFromFields(fields,
- {overflow: "constrain"}), TypeError, nonObjMsg);
+ {overflow: "constrain"}), TypeError);
assertThrows(() => cal.yearMonthFromFields(fields,
- {overflow: "reject"}), TypeError, nonObjMsg);
+ {overflow: "reject"}), TypeError);
});
-assertThrows(() => cal.yearMonthFromFields({month: 1}),
- TypeError, "invalid_argument");
-assertThrows(() => cal.yearMonthFromFields({year: 2021}),
- TypeError, "invalid_argument");
+assertThrows(() => cal.yearMonthFromFields({month: 1}), TypeError);
+assertThrows(() => cal.yearMonthFromFields({year: 2021}), TypeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "m1"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "M1"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "m01"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, month: 12,
- monthCode: "M11"}),
- RangeError, "monthCode value is out of range.");
+ monthCode: "M11"}), RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "M00"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "M19"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "M99"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, monthCode: "M13"}),
- RangeError, "monthCode value is out of range.");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, month: -1}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, month: -Infinity}),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, month: 0, day: 5},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.yearMonthFromFields({year: 2021, month: 13, day: 5},
- {overflow: "reject"}), RangeError, "Invalid time value");
+ {overflow: "reject"}), RangeError);
assertThrows(() => cal.yearMonthFromFields(
- {year: 2021, monthCode: "M00"}, {overflow: "reject"}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M00"}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.yearMonthFromFields(
- {year: 2021, monthCode: "M13"}, {overflow: "reject"}),
- RangeError, "monthCode value is out of range.");
+ {year: 2021, monthCode: "M13"}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.yearMonthFromFields(
- {year: 2021, month: 0}), RangeError, "Invalid time value");
+ {year: 2021, month: 0}), RangeError);
// Check throw for the second arg
assertThrows(() => cal.yearMonthFromFields(
- {year: 2021, month: 7}, {overflow: "invalid"}),
- RangeError,
- "Value invalid out of range for " +
- "Temporal.Calendar.prototype.yearMonthFromFields options property " +
- "overflow");
+ {year: 2021, month: 7}, {overflow: "invalid"}), RangeError);
assertEquals("2021-07",
cal.yearMonthFromFields({year: 2021, month: 7}).toJSON());
@@ -137,8 +125,6 @@ assertEquals("2021-12",
cal.yearMonthFromFields({year: 2021, monthCode: "M12"}).toJSON());
assertThrows(() => cal.yearMonthFromFields(
- {year: 2021, month: 13}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 13}, {overflow: "reject"}), RangeError);
assertThrows(() => cal.yearMonthFromFields(
- {year: 2021, month: 9995}, {overflow: "reject"}), RangeError,
- "Invalid time value");
+ {year: 2021, month: 9995}, {overflow: "reject"}), RangeError);
diff --git a/deps/v8/test/mjsunit/temporal/duration-abs.js b/deps/v8/test/mjsunit/temporal/duration-abs.js
index 181122058f..2a883899ce 100644
--- a/deps/v8/test/mjsunit/temporal/duration-abs.js
+++ b/deps/v8/test/mjsunit/temporal/duration-abs.js
@@ -12,8 +12,10 @@ let d2 = new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
assertDuration(d2.abs(), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, false);
// Test large number
-let d3 = new Temporal.Duration(1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
-assertDuration(d3.abs(), 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5, 1, false);
+let d3 = new Temporal.Duration(
+ 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
+assertDuration(d3.abs(),
+ 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5, 1, false);
// Test negative values
let d4 = new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
diff --git a/deps/v8/test/mjsunit/temporal/duration-add.js b/deps/v8/test/mjsunit/temporal/duration-add.js
index 38d63cfd42..6a02afe929 100644
--- a/deps/v8/test/mjsunit/temporal/duration-add.js
+++ b/deps/v8/test/mjsunit/temporal/duration-add.js
@@ -7,34 +7,44 @@ d8.file.execute('test/mjsunit/temporal/temporal-helpers.js');
let d1 = new Temporal.Duration();
let badDur = {add: d1.add};
-assertThrows(() => badDur.add(d1), TypeError,
- "Method Temporal.Duration.prototype.add called on incompatible receiver #<Object>");
+assertThrows(() => badDur.add(d1), TypeError);
let relativeToOptions = {relativeTo: "2021-08-01"};
let d2 = new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-assertThrows(() => d2.add(d1), RangeError, "Invalid time value");
-assertThrows(() => d1.add(d2), RangeError, "Invalid time value");
-assertThrows(() => d2.add(d2), RangeError, "Invalid time value");
-assertDuration(d2.add(d1, relativeToOptions), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, false);
-assertDuration(d1.add(d2, relativeToOptions), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, false);
-assertDuration(d1.add(d1, relativeToOptions), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
-assertDuration(d2.add(d2, relativeToOptions), 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 1, false);
+assertThrows(() => d2.add(d1), RangeError);
+assertThrows(() => d1.add(d2), RangeError);
+assertThrows(() => d2.add(d2), RangeError);
+assertDuration(d2.add(d1, relativeToOptions),
+ 1, 2, 0, 25, 5, 6, 7, 8, 9, 10, 1, false);
+assertDuration(d1.add(d2, relativeToOptions),
+ 1, 2, 0, 25, 5, 6, 7, 8, 9, 10, 1, false);
+assertDuration(d1.add(d1, relativeToOptions),
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
+assertDuration(d2.add(d2, relativeToOptions),
+ 2, 5, 0, 19, 10, 12, 14, 16, 18, 20, 1, false);
// Test large number
-let d3 = new Temporal.Duration(1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
-assertThrows(() => d3.add(d3), RangeError, "Invalid time value");
-assertDuration(d3.add(d3, relativeToOptions), 2e5, 4e5, 6e5, 8e5, 1e6, 12e5, 14e5, 16e5, 18e5, 2e6, 1, false);
+let d3 = new Temporal.Duration(
+ 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
+assertThrows(() => d3.add(d3), RangeError);
+//assertDuration(d3.add(d3, relativeToOptions),
+// 2e5, 4e5, 6e5, 8e5, 1e6, 12e5, 14e5, 16e5, 18e5, 2e6, 1, false);
// Test negative values
let d4 = new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
-assertThrows(() => d4.add(d0), RangeError, "Invalid time value");
-assertThrows(() => d0.add(d4), RangeError, "Invalid time value");
-assertThrows(() => d4.add(d4), RangeError, "Invalid time value");
-assertThrows(() => d2.add(d4), RangeError, "Invalid time value");
-assertThrows(() => d4.add(d2), RangeError, "Invalid time value");
-assertDuration(d4.add(d0, relativeToOptions), -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -1, false);
-assertDuration(d0.add(d4, relativeToOptions), -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -1, false);
-assertDuration(d4.add(d4, relativeToOptions), -2, -4, -6, -8, -10, -12, -14, -16, -18, -20, -1, false);
-assertDuration(d2.add(d4, relativeToOptions), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
-assertDuration(d4.add(d2, relativeToOptions), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
+assertThrows(() => d4.add(d1), RangeError);
+assertThrows(() => d1.add(d4), RangeError);
+assertThrows(() => d4.add(d4), RangeError);
+assertThrows(() => d2.add(d4), RangeError);
+assertThrows(() => d4.add(d2), RangeError);
+assertDuration(d4.add(d1, relativeToOptions),
+ -1, -2, 0, -25, -5, -6, -7, -8, -9, -10, -1, false);
+assertDuration(d1.add(d4, relativeToOptions),
+ -1, -2, 0, -25, -5, -6, -7, -8, -9, -10, -1, false);
+assertDuration(d4.add(d4, relativeToOptions),
+ -2, -5, 0, -19, -10, -12, -14, -16, -18, -20, -1, false);
+assertDuration(d2.add(d4, relativeToOptions),
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
+assertDuration(d4.add(d2, relativeToOptions),
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
diff --git a/deps/v8/test/mjsunit/temporal/duration-constructor.js b/deps/v8/test/mjsunit/temporal/duration-constructor.js
index 3f02034c38..a9cb2cb318 100644
--- a/deps/v8/test/mjsunit/temporal/duration-constructor.js
+++ b/deps/v8/test/mjsunit/temporal/duration-constructor.js
@@ -12,82 +12,70 @@ let d2 = new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
assertDuration(d2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, false);
// Test large number
-let d3 = new Temporal.Duration(1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
-assertDuration(d3, 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5, 1, false);
+let d3 = new Temporal.Duration(
+ 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
+assertDuration(
+ d3, 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5, 1, false);
// Test negative values
-let d4 = new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
-assertDuration(d4, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -1, false);
+let d4 = new Temporal.Duration(
+ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
+assertDuration(
+ d4, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -1, false);
// Test NaN
let d5 = new Temporal.Duration(NaN, NaN, NaN);
assertDuration(d5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
// 1. If NewTarget is undefined, then
// a. Throw a TypeError exception.
-assertThrows(() => Temporal.Duration(), TypeError,
- "Method invoked on an object that is not Temporal.Duration.");
+assertThrows(() => Temporal.Duration(), TypeError);
// 1. Let number be ? ToNumber(argument).
assertDuration(new Temporal.Duration(undefined, 234, true, false, "567"),
0, 234, 1, 0, 567, 0, 0, 0, 0, 0, 1, false);
-assertThrows(() => new Temporal.Duration(Symbol(123)), TypeError,
- "Cannot convert a Symbol value to a number");
-assertThrows(() => new Temporal.Duration(123n), TypeError,
- "Cannot convert a BigInt value to a number");
+assertThrows(() => new Temporal.Duration(Symbol(123)), TypeError);
+assertThrows(() => new Temporal.Duration(123n), TypeError);
// Test Infinity
// 7.5.4 IsValidDuration ( years, months, weeks, days, hours, minutes, seconds,
// milliseconds, microseconds, nanoseconds )
// a. If v is not finite, return false.
assertThrows(() => new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 8, 9, Infinity),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 8, Infinity),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, Infinity),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => new Temporal.Duration(1, 2, 3, 4, 5, 6, Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(1, 2, 3, 4, 5, Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(1, 2, 3, 4, Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(1, 2, 3, Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(1, 2, Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(1, Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(Infinity),
- RangeError, "Invalid time value");
+ RangeError);
+assertThrows(() => new Temporal.Duration(1, 2, 3, 4, 5, Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(1, 2, 3, 4, Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(1, 2, 3, Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(1, 2, Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(1, Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(Infinity), RangeError);
assertThrows(() => new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8, -9,
- -Infinity), RangeError, "Invalid time value");
+ -Infinity), RangeError);
assertThrows(() => new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8,
- -Infinity), RangeError, "Invalid time value");
+ -Infinity), RangeError);
assertThrows(() => new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7,
- -Infinity), RangeError, "Invalid time value");
+ -Infinity), RangeError);
assertThrows(() => new Temporal.Duration(-1, -2, -3, -4, -5, -6, -Infinity),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => new Temporal.Duration(-1, -2, -3, -4, -5, -Infinity),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => new Temporal.Duration(-1, -2, -3, -4, -Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(-1, -2, -3, -Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(-1, -2, -Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(-1, -Infinity),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(-Infinity),
- RangeError, "Invalid time value");
+ RangeError);
+assertThrows(() => new Temporal.Duration(-1, -2, -3, -Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(-1, -2, -Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(-1, -Infinity), RangeError);
+assertThrows(() => new Temporal.Duration(-Infinity), RangeError);
// Sign different
-assertThrows(() => new Temporal.Duration(1, -2),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(1, 0, -2),
- RangeError, "Invalid time value");
-assertThrows(() => new Temporal.Duration(-1, 0, 0, 3),
- RangeError, "Invalid time value");
+assertThrows(() => new Temporal.Duration(1, -2), RangeError);
+assertThrows(() => new Temporal.Duration(1, 0, -2), RangeError);
+assertThrows(() => new Temporal.Duration(-1, 0, 0, 3), RangeError);
assertThrows(() => new Temporal.Duration(0, 0, 0, 0, 0, 0, 0, 0, 1, -1),
- RangeError, "Invalid time value");
+ RangeError);
assertThrows(() => new Temporal.Duration(0, 0, 0, 0, 0, 0, 0, 0, -1, 1),
- RangeError, "Invalid time value");
+ RangeError);
diff --git a/deps/v8/test/mjsunit/temporal/duration-from.js b/deps/v8/test/mjsunit/temporal/duration-from.js
index 8e19063c8a..107ad32d37 100644
--- a/deps/v8/test/mjsunit/temporal/duration-from.js
+++ b/deps/v8/test/mjsunit/temporal/duration-from.js
@@ -163,50 +163,28 @@ assertDuration(Temporal.Duration.from("PT3,001M"),
assertDuration(Temporal.Duration.from("PT3,006M"),
0, 0, 0, 0, 0, 3, 0, 360, 0, 0, 1, false);
-assertThrows(() => Temporal.Duration.from("P2H"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("P2.5M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("P2,5M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("P2S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2.H3M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2,H3M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2.H3S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2,H3S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2.H0.5M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2,H0,5M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2.H0.5S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2,H0,5S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2H3.2M3S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2H3,2M3S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2H3.2M0.3S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT2H3,2M0,3S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT.1H"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT,1H"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT.1M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT,1M"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT.1S"), RangeError,
- "Invalid time value");
-assertThrows(() => Temporal.Duration.from("PT,1S"), RangeError,
- "Invalid time value");
+assertThrows(() => Temporal.Duration.from("P2H"), RangeError);
+assertThrows(() => Temporal.Duration.from("P2.5M"), RangeError);
+assertThrows(() => Temporal.Duration.from("P2,5M"), RangeError);
+assertThrows(() => Temporal.Duration.from("P2S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2.H3M"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2,H3M"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2.H3S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2,H3S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2.H0.5M"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2,H0,5M"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2.H0.5S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2,H0,5S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2H3.2M3S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2H3,2M3S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2H3.2M0.3S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT2H3,2M0,3S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT.1H"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT,1H"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT.1M"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT,1M"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT.1S"), RangeError);
+assertThrows(() => Temporal.Duration.from("PT,1S"), RangeError);
assertDuration(Temporal.Duration.from(
{years: 0, months: 0, weeks: 0, days: 0,
diff --git a/deps/v8/test/mjsunit/temporal/duration-negated.js b/deps/v8/test/mjsunit/temporal/duration-negated.js
index a161a819d3..033f24d5ee 100644
--- a/deps/v8/test/mjsunit/temporal/duration-negated.js
+++ b/deps/v8/test/mjsunit/temporal/duration-negated.js
@@ -12,13 +12,17 @@ let d2 = new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
assertDuration(d2.negated(), -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -1, false);
// Test large number
-let d3 = new Temporal.Duration(1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
-assertDuration(d3.negated(), -1e5, -2e5, -3e5, -4e5, -5e5, -6e5, -7e5, -8e5, -9e5, -10e5, -1, false);
+let d3 = new Temporal.Duration(
+ 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5);
+assertDuration(d3.negated(),
+ -1e5, -2e5, -3e5, -4e5, -5e5, -6e5, -7e5, -8e5, -9e5, -10e5, -1, false);
// Test negative values
let d4 = new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
assertDuration(d4.negated(), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, false);
-let d5 = new Temporal.Duration(-1e5, -2e5, -3e5, -4e5, -5e5, -6e5, -7e5, -8e5, -9e5, -10e5);
-assertDuration(d5.negated(), 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5, 1, false);
+let d5 = new Temporal.Duration(
+ -1e5, -2e5, -3e5, -4e5, -5e5, -6e5, -7e5, -8e5, -9e5, -10e5);
+assertDuration(d5.negated(),
+ 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5, 1, false);
diff --git a/deps/v8/test/mjsunit/temporal/duration-valueOf.js b/deps/v8/test/mjsunit/temporal/duration-valueOf.js
index 1a948868f3..6b1e08bf27 100644
--- a/deps/v8/test/mjsunit/temporal/duration-valueOf.js
+++ b/deps/v8/test/mjsunit/temporal/duration-valueOf.js
@@ -4,5 +4,4 @@
// Flags: --harmony-temporal
let d1 = new Temporal.Duration();
-assertThrows(() => d1.valueOf(), TypeError,
- "Method Temporal.Duration called on a non-object or on a wrong type of object.");
+assertThrows(() => d1.valueOf(), TypeError);
diff --git a/deps/v8/test/mjsunit/temporal/duration-with.js b/deps/v8/test/mjsunit/temporal/duration-with.js
index ec9d775057..e3d71d2550 100644
--- a/deps/v8/test/mjsunit/temporal/duration-with.js
+++ b/deps/v8/test/mjsunit/temporal/duration-with.js
@@ -32,26 +32,16 @@ assertDuration(d2.with(like1), 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 1, false);
assertDuration(d2.with(like7), -9, -8, -7, -6, -5, -4, -3, -2, -1, -10, -1,
false);
// Different sign
-assertThrows(() => d2.with({years: -1}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({months: -2}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({weeks: -3}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({days: -4}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({hours: -5}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({minutes: -6}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({seconds: -7}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({milliseconds: -8}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({microseconds: -9}), RangeError,
- "Invalid time value");
-assertThrows(() => d2.with({nanoseconds: -10}), RangeError,
- "Invalid time value");
+assertThrows(() => d2.with({years: -1}), RangeError);
+assertThrows(() => d2.with({months: -2}), RangeError);
+assertThrows(() => d2.with({weeks: -3}), RangeError);
+assertThrows(() => d2.with({days: -4}), RangeError);
+assertThrows(() => d2.with({hours: -5}), RangeError);
+assertThrows(() => d2.with({minutes: -6}), RangeError);
+assertThrows(() => d2.with({seconds: -7}), RangeError);
+assertThrows(() => d2.with({milliseconds: -8}), RangeError);
+assertThrows(() => d2.with({microseconds: -9}), RangeError);
+assertThrows(() => d2.with({nanoseconds: -10}), RangeError);
// Test large number
@@ -68,45 +58,25 @@ let d4 = new Temporal.Duration(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
assertDuration(d4, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -1, false);
assertDuration(d4.with(like1), 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 1, false);
// Throw when sign flip
-assertThrows(() => d4.with({years: 1}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({months: 2}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({weeks: 3}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({days: 4}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({hours: 5}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({minutes: 6}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({seconds: 7}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({milliseconds: 8}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({microseconds: 9}), RangeError,
- "Invalid time value");
-assertThrows(() => d4.with({nanoseconds: 10}), RangeError,
- "Invalid time value");
+assertThrows(() => d4.with({years: 1}), RangeError);
+assertThrows(() => d4.with({months: 2}), RangeError);
+assertThrows(() => d4.with({weeks: 3}), RangeError);
+assertThrows(() => d4.with({days: 4}), RangeError);
+assertThrows(() => d4.with({hours: 5}), RangeError);
+assertThrows(() => d4.with({minutes: 6}), RangeError);
+assertThrows(() => d4.with({seconds: 7}), RangeError);
+assertThrows(() => d4.with({milliseconds: 8}), RangeError);
+assertThrows(() => d4.with({microseconds: 9}), RangeError);
+assertThrows(() => d4.with({nanoseconds: 10}), RangeError);
// singular throw
-assertThrows(() => d1.with({year:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({month:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({week:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({day:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({hour:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({minute:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({second:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({millisecond:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({microsecond:1}), TypeError,
- "invalid_argument");
-assertThrows(() => d1.with({nanosecond:1}), TypeError,
- "invalid_argument");
+assertThrows(() => d1.with({year:1}), TypeError);
+assertThrows(() => d1.with({month:1}), TypeError);
+assertThrows(() => d1.with({week:1}), TypeError);
+assertThrows(() => d1.with({day:1}), TypeError);
+assertThrows(() => d1.with({hour:1}), TypeError);
+assertThrows(() => d1.with({minute:1}), TypeError);
+assertThrows(() => d1.with({second:1}), TypeError);
+assertThrows(() => d1.with({millisecond:1}), TypeError);
+assertThrows(() => d1.with({microsecond:1}), TypeError);
+assertThrows(() => d1.with({nanosecond:1}), TypeError);
diff --git a/deps/v8/test/mjsunit/temporal/plain-date-add.js b/deps/v8/test/mjsunit/temporal/plain-date-add.js
index 4734dede1d..fc5cccf8f8 100644
--- a/deps/v8/test/mjsunit/temporal/plain-date-add.js
+++ b/deps/v8/test/mjsunit/temporal/plain-date-add.js
@@ -18,7 +18,7 @@ assertPlainDate(d.subtract("-P12D"), 2021, 8, 1);
let goodDate = new Temporal.PlainDate(2021, 7, 20);
let badDate = {add: goodDate.add};
-assertThrows(() => badDateTime.add("P1D"), TypeError);
+assertThrows(() => badDate.add("P1D"), TypeError);
// Throw in ToLimitedTemporalDuration
assertThrows(() => (new Temporal.PlainDate(2021, 7, 20)).add("bad duration"),
diff --git a/deps/v8/test/mjsunit/temporal/plain-date-time-from.js b/deps/v8/test/mjsunit/temporal/plain-date-time-from.js
index c308e57e1b..380f1e6a37 100644
--- a/deps/v8/test/mjsunit/temporal/plain-date-time-from.js
+++ b/deps/v8/test/mjsunit/temporal/plain-date-time-from.js
@@ -98,4 +98,4 @@ assertThrows(() => Temporal.PlainDateTime.from(
assertThrows(() => Temporal.PlainDateTime.from(
{year:9, month: 12, day:31, nanosecond: 1000}, {overflow: "reject"}),
- RangeError
+ RangeError);
diff --git a/deps/v8/test/mjsunit/temporal/temporal-helpers.js b/deps/v8/test/mjsunit/temporal/temporal-helpers.js
index 129f918608..2fcf71d468 100644
--- a/deps/v8/test/mjsunit/temporal/temporal-helpers.js
+++ b/deps/v8/test/mjsunit/temporal/temporal-helpers.js
@@ -6,18 +6,18 @@
function assertDuration(duration, years, months, weeks, days, hours,
minutes, seconds, milliseconds, microseconds, nanoseconds, sign, blank) {
- assertEquals(years, duration.years, duration);
- assertEquals(months, duration.months, duration);
- assertEquals(weeks, duration.weeks, duration);
- assertEquals(days, duration.days, duration);
- assertEquals(hours, duration.hours, duration);
- assertEquals(minutes, duration.minutes, duration);
- assertEquals(seconds, duration.seconds, duration);
- assertEquals(milliseconds, duration.milliseconds, duration);
- assertEquals(microseconds, duration.microseconds, duration);
- assertEquals(nanoseconds, duration.nanoseconds, duration);
- assertEquals(sign, duration.sign, duration);
- assertEquals(blank, duration.blank, duration);
+ assertEquals(years, duration.years, "years");
+ assertEquals(months, duration.months, "months");
+ assertEquals(weeks, duration.weeks, "weeks");
+ assertEquals(days, duration.days, "days");
+ assertEquals(hours, duration.hours, "hours");
+ assertEquals(minutes, duration.minutes, "minutes");
+ assertEquals(seconds, duration.seconds, "seconds");
+ assertEquals(milliseconds, duration.milliseconds, "milliseconds");
+ assertEquals(microseconds, duration.microseconds, "microseconds");
+ assertEquals(nanoseconds, duration.nanoseconds, "nanoseconds");
+ assertEquals(sign, duration.sign, "sign");
+ assertEquals(blank, duration.blank, "blank");
}
function assertPlainDate(time, year, month, day) {
diff --git a/deps/v8/test/mjsunit/temporal/time-zone-constructor.js b/deps/v8/test/mjsunit/temporal/time-zone-constructor.js
new file mode 100644
index 0000000000..5048e9fd00
--- /dev/null
+++ b/deps/v8/test/mjsunit/temporal/time-zone-constructor.js
@@ -0,0 +1,12 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+// Flags: --harmony-temporal
+
+// 1. If NewTarget is undefined, then
+// a. Throw a TypeError exception.
+assertThrows(() => Temporal.TimeZone("UTC"), TypeError);
+
+assertThrows(() => new Temporal.TimeZone(), RangeError);
+
+assertEquals("UTC", (new Temporal.TimeZone("utc")).id)