summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Temporal/Calendar
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Temporal/Calendar')
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js28
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js3
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js25
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js28
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js3
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js25
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js30
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js25
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js8
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js30
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js25
-rw-r--r--js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js8
30 files changed, 380 insertions, 2 deletions
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js
new file mode 100644
index 0000000000..2772960abe
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js
@@ -0,0 +1,28 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.era
+description: An ISO 8601 string can be converted to a calendar ID in Calendar
+features: [Temporal]
+---*/
+
+const instance = new Temporal.Calendar("iso8601");
+
+for (const calendar of [
+ "2020-01-01",
+ "2020-01-01[u-ca=iso8601]",
+ "2020-01-01T00:00:00.000000000",
+ "2020-01-01T00:00:00.000000000[u-ca=iso8601]",
+ "01-01",
+ "01-01[u-ca=iso8601]",
+ "2020-01",
+ "2020-01[u-ca=iso8601]",
+]) {
+ const arg = { year: 1976, monthCode: "M11", day: 18, calendar };
+ const result = instance.era(arg);
+ assert.sameValue(result, undefined, `Calendar created from string "${calendar}"`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js
index d0698c070c..57df6364f9 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js
@@ -16,7 +16,8 @@ const invalidStrings = [
"-000000-10-31T17:45+00:00[UTC]",
];
const instance = new Temporal.Calendar("iso8601");
-invalidStrings.forEach((arg) => {
+invalidStrings.forEach((str) => {
+ const arg = { year: 1976, month: 11, day: 18, calendar: str };
assert.throws(
RangeError,
() => instance.era(arg),
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js
new file mode 100644
index 0000000000..f34a405169
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js
@@ -0,0 +1,25 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.era
+description: Annotation keys are lowercase-only
+features: [Temporal]
+---*/
+
+const invalidStrings = [
+ ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
+ ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
+ ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
+];
+const instance = new Temporal.Calendar("iso8601");
+invalidStrings.forEach(([arg, descr]) => {
+ assert.throws(
+ RangeError,
+ () => instance.era(arg),
+ `annotation keys must be lowercase: ${arg} - ${descr}`
+ );
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js
index 32df7c4217..63bc783738 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js
@@ -2046,6 +2046,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2133,6 +2136,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js
new file mode 100644
index 0000000000..2899ea877c
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js
@@ -0,0 +1,28 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.erayear
+description: An ISO 8601 string can be converted to a calendar ID in Calendar
+features: [Temporal]
+---*/
+
+const instance = new Temporal.Calendar("iso8601");
+
+for (const calendar of [
+ "2020-01-01",
+ "2020-01-01[u-ca=iso8601]",
+ "2020-01-01T00:00:00.000000000",
+ "2020-01-01T00:00:00.000000000[u-ca=iso8601]",
+ "01-01",
+ "01-01[u-ca=iso8601]",
+ "2020-01",
+ "2020-01[u-ca=iso8601]",
+]) {
+ const arg = { year: 1976, monthCode: "M11", day: 18, calendar };
+ const result = instance.eraYear(arg);
+ assert.sameValue(result, undefined, `Calendar created from string "${calendar}"`);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js
index 65675a5894..eaa93d916a 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js
@@ -16,7 +16,8 @@ const invalidStrings = [
"-000000-10-31T17:45+00:00[UTC]",
];
const instance = new Temporal.Calendar("iso8601");
-invalidStrings.forEach((arg) => {
+invalidStrings.forEach((str) => {
+ const arg = { year: 1976, month: 11, day: 18, calendar: str };
assert.throws(
RangeError,
() => instance.eraYear(arg),
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js
new file mode 100644
index 0000000000..7bec3d6a54
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js
@@ -0,0 +1,25 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.erayear
+description: Annotation keys are lowercase-only
+features: [Temporal]
+---*/
+
+const invalidStrings = [
+ ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
+ ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
+ ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
+];
+const instance = new Temporal.Calendar("iso8601");
+invalidStrings.forEach(([arg, descr]) => {
+ assert.throws(
+ RangeError,
+ () => instance.eraYear(arg),
+ `annotation keys must be lowercase: ${arg} - ${descr}`
+ );
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js
index 32df7c4217..63bc783738 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js
@@ -2046,6 +2046,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2133,6 +2136,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js
new file mode 100644
index 0000000000..3eeb8186ef
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js
@@ -0,0 +1,30 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.weekofyear
+description: >
+ In the ISO 8601 week calendar, calendar week number 1 of a calendar year is
+ the week including the first Thursday of that year (based on the principle
+ that a week belongs to the same calendar year as the majority of its calendar
+ days). Because of this, some calendar days of the first calendar week of a
+ calendar year may be part of the preceding date calendar year, and some
+ calendar days of the last calendar week of a calendar year may be part of
+ the next calendar year.
+features: [Temporal]
+---*/
+
+//
+
+let calendar = new Temporal.Calendar("gregory");
+const date = { month: 1, day: 1, year: 2021, calendar};
+
+assert.sameValue(calendar.weekOfYear({...date}), 1);
+
+calendar = new Temporal.Calendar("iso8601");
+const isodate = { month: 1, day: 1, year: 2021, calendar};
+
+assert.sameValue(calendar.weekOfYear({...isodate}), 53);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js
new file mode 100644
index 0000000000..9392c0c13b
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js
@@ -0,0 +1,25 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.weekofyear
+description: >
+ Temporal.Calendar.prototype.weekOfYear returns undefined for all
+ non-ISO calendars without a well-defined week numbering system.
+features: [Temporal]
+---*/
+
+// Gregorian calendar has a well defined week-numbering system.
+
+let calendar = new Temporal.Calendar("gregory");
+const date = { month: 1, day: 1, year: 2024, calendar};
+
+assert.sameValue(calendar.weekOfYear({...date}), 1);
+
+calendar = new Temporal.Calendar("hebrew");
+const nonisodate = { month: 1, day: 1, year: 2024, calendar};
+
+assert.sameValue(calendar.weekOfYear({...nonisodate}), undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js
new file mode 100644
index 0000000000..ff2d9c0b60
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js
@@ -0,0 +1,30 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.yearofweek
+description: >
+ In the ISO 8601 week calendar, calendar week number 1 of a calendar year is
+ the week including the first Thursday of that year (based on the principle
+ that a week belongs to the same calendar year as the majority of its calendar
+ days). Because of this, some calendar days of the first calendar week of a
+ calendar year may be part of the preceding date calendar year, and some
+ calendar days of the last calendar week of a calendar year may be part of
+ the next calendar year.
+features: [Temporal]
+---*/
+
+//
+
+let calendar = new Temporal.Calendar("gregory");
+const date = { month: 1, day: 1, year: 2021, calendar};
+
+assert.sameValue(calendar.yearOfWeek({...date}), 2021);
+
+calendar = new Temporal.Calendar("iso8601");
+const isodate = { month: 1, day: 1, year: 2021, calendar};
+
+assert.sameValue(calendar.yearOfWeek({...isodate}), 2020);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js
new file mode 100644
index 0000000000..9abf674f0f
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js
@@ -0,0 +1,25 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2024 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.calendar.prototype.yearofweek
+description: >
+ Temporal.Calendar.prototype.yearOfWeek returns undefined for all
+ non-ISO calendars without a well-defined week numbering system.
+features: [Temporal]
+---*/
+
+// Gregorian calendar has a well defined week-numbering system.
+
+let calendar = new Temporal.Calendar("gregory");
+const date = { month: 1, day: 1, year: 2024, calendar};
+
+assert.sameValue(calendar.yearOfWeek({...date}), 2024);
+
+calendar = new Temporal.Calendar("hebrew");
+const nonisodate = { month: 1, day: 1, year: 2024, calendar};
+
+assert.sameValue(calendar.yearOfWeek({...nonisodate}), undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js
index 60f74c2518..5265d86aa2 100644
--- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js
+++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js
@@ -2022,6 +2022,9 @@ var TemporalHelpers = {
"11-18junk",
"11-18[u-ca=gregory]",
"11-18[u-ca=hebrew]",
+ "11-18[U-CA=iso8601]",
+ "11-18[u-CA=iso8601]",
+ "11-18[FOO=bar]",
];
},
@@ -2109,6 +2112,11 @@ var TemporalHelpers = {
plainYearMonthStringsInvalid() {
return [
"2020-13",
+ "1976-11[u-ca=gregory]",
+ "1976-11[u-ca=hebrew]",
+ "1976-11[U-CA=iso8601]",
+ "1976-11[u-CA=iso8601]",
+ "1976-11[FOO=bar]",
];
},