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

LibJS: Handle possible allocation failure in ArrayBuffer(size_t)

...by replacing it with a ctor that takes the buffer instead, and
handling the allocation failure in ArrayBuffer::create(size_t) by
throwing a RangeError as specified by the spec.
This commit is contained in:
Ali Mohammad Pur 2021-09-05 14:43:15 +04:30 committed by Andreas Kling
parent d20fc922c5
commit 7589cc2494
5 changed files with 22 additions and 6 deletions

View file

@ -27,7 +27,7 @@ public:
static ArrayBuffer* create(GlobalObject&, size_t);
static ArrayBuffer* create(GlobalObject&, ByteBuffer*);
ArrayBuffer(size_t, Object& prototype);
ArrayBuffer(ByteBuffer buffer, Object& prototype);
ArrayBuffer(ByteBuffer* buffer, Object& prototype);
virtual ~ArrayBuffer() override;