1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:57:35 +00:00

LibJS: Implement missing checks for SharedArrayBuffer values

This commit is contained in:
Timothy Flynn 2023-12-28 09:27:42 -05:00 committed by Andreas Kling
parent 299c86db20
commit 526a74f2f1
6 changed files with 46 additions and 6 deletions

View file

@ -1,3 +1,11 @@
describe("errors", () => {
test("called on SharedArrayBuffer object", () => {
expect(() => {
ArrayBuffer.prototype.slice.call(new SharedArrayBuffer());
}).toThrowWithMessage(TypeError, "The array buffer object cannot be a SharedArrayBuffer");
});
});
test("single parameter", () => {
const buffer = new ArrayBuffer(16);
const fullView = new Int32Array(buffer);