1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:18:11 +00:00

LibJS: Add spec comment for IsDetachedBuffer ( arrayBuffer )

This commit is contained in:
Shannon Booth 2023-06-28 17:20:44 +12:00 committed by Linus Groh
parent 8ac4a5315b
commit 78d5c23c3a

View file

@ -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,