mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
LibJS/Temporal: Allow annotations after YYYY-MM and MM-DD
This is a normative change in the Temporal spec.
See: 160e836
This commit is contained in:
parent
421b1eee49
commit
588dae8aa6
8 changed files with 290 additions and 136 deletions
|
@ -54,4 +54,20 @@ describe("errors", () => {
|
|||
"Got unexpected TimeZone object in conversion to Calendar"
|
||||
);
|
||||
});
|
||||
|
||||
test("yyyy-mm and mm-dd strings can only use the iso8601 calendar", () => {
|
||||
// FIXME: The error message doesn't really indicate this is the case.
|
||||
const values = [
|
||||
"02-10[u-ca=iso8602]",
|
||||
"02-10[u-ca=SerenityOS]",
|
||||
"2023-02[u-ca=iso8602]",
|
||||
"2023-02[u-ca=SerenityOS]",
|
||||
];
|
||||
|
||||
for (const value of values) {
|
||||
expect(() => {
|
||||
Temporal.Calendar.from(value);
|
||||
}).toThrowWithMessage(RangeError, `Invalid calendar string '${value}'`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue