diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek')
4 files changed, 55 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/browser.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/browser.js diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..a3846e5d01 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/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.plaindatetime.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 = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(date.yearOfWeek, 2021); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(isodate.yearOfWeek, 2020); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js new file mode 100644 index 0000000000..cffb030267 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/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.plaindatetime.prototype.yearofweek +description: > + Temporal.PlainDateTime.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 = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(date.yearOfWeek, 2024); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(nonisodate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/shell.js |