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())
{
}