mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
LibJS: Disallow creating ArrayBuffers larger than 2^53 - 1
This is a normative change in the ECMA-262 spec. See:
25f9744
This commit is contained in:
parent
d31b780760
commit
706a20c4d4
2 changed files with 25 additions and 4 deletions
|
@ -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");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue