mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS: Differentiate between failed ISO8601 parsing and invalid values
If we were able to parse an ISO8601 Date string, but the parse results in an invalid date (e.g. out of the min/max range), we should abort parsing immediately.
This commit is contained in:
parent
511029807a
commit
fc6155cf2c
Notes:
github-actions[bot]
2024-11-26 21:57:31 +00:00
Author: https://github.com/trflynn89
Commit: fc6155cf2c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2594
2 changed files with 11 additions and 7 deletions
|
@ -67,6 +67,12 @@ test("basic functionality", () => {
|
|||
test("time clip", () => {
|
||||
expect(Date.parse("+999999")).toBeNaN();
|
||||
expect(Date.parse("-999999")).toBeNaN();
|
||||
|
||||
const belowMinDate = "-271821-04-19T23:59:59.999Z";
|
||||
expect(belowMinDate).toBeNaN();
|
||||
|
||||
const aboveMaxDate = "+275760-09-13T00:00:00.001Z";
|
||||
expect(aboveMaxDate).toBeNaN();
|
||||
});
|
||||
|
||||
test("extra micro seconds extension", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue