mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Implement and test getters added by resizable ArrayBuffer
This commit is contained in:
parent
e01ee4e30b
commit
b29e19c52a
Notes:
sideshowbarker
2024-07-17 18:01:39 +09:00
Author: https://github.com/ForLoveOfCats
Commit: b29e19c52a
Pull-request: https://github.com/SerenityOS/serenity/pull/12595
Reviewed-by: https://github.com/davidot
Reviewed-by: https://github.com/linusg
6 changed files with 113 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue