mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibJS: Add generic InvalidLength error type
We have multiple array types now, so ArrayInvalidLength has been replaced with a generic InvalidLength. Also fixes a small issue in the Array constructor, it should throw RangeError for invalid lengths, not TypeError.
This commit is contained in:
committed by
Andreas Kling
parent
5e08ae4e14
commit
6de4f1fcb3
Notes:
sideshowbarker
2024-07-19 01:05:16 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/6de4f1fcb38 Pull-request: https://github.com/SerenityOS/serenity/pull/4307
@@ -9,7 +9,7 @@ describe("errors", () => {
|
||||
[-1, -100, -0.1, 0.1, 1.23, Infinity, -Infinity, NaN].forEach(value => {
|
||||
expect(() => {
|
||||
new Array(value);
|
||||
}).toThrowWithMessage(TypeError, "Invalid array length");
|
||||
}).toThrowWithMessage(RangeError, "Invalid array length");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user