mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibJS: Implement and test getters added by resizable ArrayBuffer
This commit is contained in:
committed by
Linus Groh
parent
e01ee4e30b
commit
b29e19c52a
Notes:
sideshowbarker
2024-07-17 18:01:39 +09:00
Author: https://github.com/ForLoveOfCats Commit: https://github.com/SerenityOS/serenity/commit/b29e19c52a Pull-request: https://github.com/SerenityOS/serenity/pull/12595 Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user