mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibJS: Add spec comment for IsDetachedBuffer ( arrayBuffer )
This commit is contained in:
parent
8ac4a5315b
commit
78d5c23c3a
1 changed files with 10 additions and 1 deletions
|
@ -43,7 +43,16 @@ public:
|
|||
void set_detach_key(Value detach_key) { m_detach_key = detach_key; }
|
||||
|
||||
void detach_buffer() { m_buffer = Empty {}; }
|
||||
bool is_detached() const { return m_buffer.has<Empty>(); }
|
||||
|
||||
// 25.1.2.2 IsDetachedBuffer ( arrayBuffer ), https://tc39.es/ecma262/#sec-isdetachedbuffer
|
||||
bool is_detached() const
|
||||
{
|
||||
// 1. If arrayBuffer.[[ArrayBufferData]] is null, return true.
|
||||
if (m_buffer.has<Empty>())
|
||||
return true;
|
||||
// 2. Return false.
|
||||
return false;
|
||||
}
|
||||
|
||||
enum Order {
|
||||
SeqCst,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue