1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 15:08:12 +00:00

LibJS: Implement and test getters added by resizable ArrayBuffer

This commit is contained in:
ForLoveOfCats 2022-03-02 11:45:26 -05:00 committed by Linus Groh
parent e01ee4e30b
commit b29e19c52a
6 changed files with 113 additions and 0 deletions

View file

@ -48,6 +48,16 @@ ArrayBuffer::~ArrayBuffer()
{
}
// 1.1.5 IsResizableArrayBuffer ( arrayBuffer ), https://tc39.es/proposal-resizablearraybuffer/#sec-isresizablearraybuffer
bool ArrayBuffer::is_resizable_array_buffer() const
{
// 1. Assert: Type(arrayBuffer) is Object and arrayBuffer has an [[ArrayBufferData]] internal slot.
// 2. If buffer has an [[ArrayBufferMaxByteLength]] internal slot, return true.
// 3. Return false.
return m_max_byte_length.has_value();
}
void ArrayBuffer::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);