1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:07:34 +00:00

LibJS: Use AllocateArrayBuffer where the spec tells us to

This commit is contained in:
Linus Groh 2021-10-09 12:32:26 +01:00
parent 1fba5ca8c3
commit 5b61b60bbd
3 changed files with 7 additions and 16 deletions

View file

@ -55,7 +55,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyMemoryPrototype::buffer_getter)
if (!memory)
return JS::js_undefined();
auto array_buffer = JS::ArrayBuffer::create(global_object, &memory->data());
auto array_buffer = TRY_OR_DISCARD(JS::ArrayBuffer::create(global_object, &memory->data()));
array_buffer->set_detach_key(JS::js_string(vm, "WebAssembly.Memory"));
return array_buffer;
}