mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb: Set a detach key for ArrayBuffers returned from WASM
As required by the specification: `Set buffer.[[ArrayBufferDetachKey]] to "WebAssembly.Memory".`
This commit is contained in:
committed by
Linus Groh
parent
a64089092f
commit
f5a978c1aa
@@ -441,7 +441,9 @@ JS_DEFINE_NATIVE_GETTER(WebAssemblyMemoryObject::buffer)
|
||||
if (!memory)
|
||||
return JS::js_undefined();
|
||||
|
||||
return JS::ArrayBuffer::create(global_object, &memory->data());
|
||||
auto array_buffer = JS::ArrayBuffer::create(global_object, &memory->data());
|
||||
array_buffer->set_detach_key(JS::js_string(vm, "WebAssembly.Memory"));
|
||||
return array_buffer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user