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

LibJS: Allow and check for detached ArrayBuffers

This is required by the specification and will be used for the
$262.detachArrayBuffer method in test262.
This commit is contained in:
Idan Horowitz 2021-06-10 22:44:17 +03:00 committed by Linus Groh
parent 7d6db3f09b
commit 8527f00065
6 changed files with 46 additions and 11 deletions

View file

@ -22,12 +22,14 @@ ArrayBuffer* ArrayBuffer::create(GlobalObject& global_object, ByteBuffer* buffer
ArrayBuffer::ArrayBuffer(size_t byte_size, Object& prototype)
: Object(prototype)
, m_buffer(ByteBuffer::create_zeroed(byte_size))
, m_detach_key(js_undefined())
{
}
ArrayBuffer::ArrayBuffer(ByteBuffer* buffer, Object& prototype)
: Object(prototype)
, m_buffer(buffer)
, m_detach_key(js_undefined())
{
}