1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

LibJS: Add ArrayBuffer

This commit is contained in:
Linus Groh 2020-12-02 20:49:31 +00:00 committed by Andreas Kling
parent cf9da66b3e
commit 32571dfa53
14 changed files with 426 additions and 11 deletions

View file

@ -0,0 +1,13 @@
test("basic functionality", () => {
expect(ArrayBuffer).toHaveLength(1);
expect(ArrayBuffer.name).toBe("ArrayBuffer");
expect(ArrayBuffer.prototype.constructor).toBe(ArrayBuffer);
expect(new ArrayBuffer()).toBeInstanceOf(ArrayBuffer);
expect(typeof new ArrayBuffer()).toBe("object");
});
test("ArrayBuffer constructor must be invoked with 'new'", () => {
expect(() => {
ArrayBuffer();
}).toThrowWithMessage(TypeError, "ArrayBuffer constructor must be called with 'new'");
});