mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
LibJS: Implement and test getters added by resizable ArrayBuffer
This commit is contained in:
parent
e01ee4e30b
commit
b29e19c52a
6 changed files with 113 additions and 0 deletions
|
@ -34,6 +34,7 @@ public:
|
|||
virtual ~ArrayBuffer() override;
|
||||
|
||||
size_t byte_length() const { return buffer_impl().size(); }
|
||||
size_t max_byte_length() const { return m_max_byte_length.value(); } // Will VERIFY() that it has value
|
||||
ByteBuffer& buffer() { return buffer_impl(); }
|
||||
const ByteBuffer& buffer() const { return buffer_impl(); }
|
||||
|
||||
|
@ -47,6 +48,8 @@ public:
|
|||
void detach_buffer() { m_buffer = Empty {}; }
|
||||
bool is_detached() const { return m_buffer.has<Empty>(); }
|
||||
|
||||
bool is_resizable_array_buffer() const;
|
||||
|
||||
enum Order {
|
||||
SeqCst,
|
||||
Unordered
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue