ladybird/Userland/Libraries/LibJS/Tests/builtins/ArrayBuffer/ArrayBuffer.js
Linus Groh 028a6b90b1 LibJS: Revert partial resizable ArrayBuffer implementation
This is a manual but clean revert of all commits from #12595.

Adding a partial implementation of the resizable ArrayBuffer proposal
without implementing all the updates to TypedArray infrastructure that
is also covered by the spec introduced a bunch of crashes, so we
decided to revert it for now until a full implementation is completed.
2022-07-06 15:52:57 +02:00

13 lines
513 B
JavaScript

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'");
});