mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Disallow creating ArrayBuffers larger than 2^53 - 1
This is a normative change in the ECMA-262 spec. See: https://github.com/tc39/ecma262/commit/25f9744
This commit is contained in:
committed by
Andreas Kling
parent
d31b780760
commit
706a20c4d4
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/706a20c4d4 Pull-request: https://github.com/SerenityOS/serenity/pull/19039
@@ -11,3 +11,9 @@ test("ArrayBuffer constructor must be invoked with 'new'", () => {
|
||||
ArrayBuffer();
|
||||
}).toThrowWithMessage(TypeError, "ArrayBuffer constructor must be called with 'new'");
|
||||
});
|
||||
|
||||
test("ArrayBuffer size limit", () => {
|
||||
expect(() => {
|
||||
new ArrayBuffer(2 ** 53);
|
||||
}).toThrowWithMessage(RangeError, "Invalid array buffer length");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user