LibWeb: Replace incorrect empty Optional return with ByteBuffer
This function initially returned a ByteBuffer, so `return {}` was fine. It was then changed to return Optional<ByteBuffer>, so we accidentally started returning an empty Optional instead. Explicitly specify the constructor name to fix this. Thanks to DexesTTP for catching this!
This commit is contained in:
parent
9090dea1e2
commit
5f993eecdb
Notes:
sideshowbarker
2024-07-17 22:47:17 +09:00
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ Optional<ByteBuffer> get_buffer_source_copy(JS::Object const& buffer_source)
|
|||
|
||||
// 7. If ! IsDetachedBuffer(esArrayBuffer) is true, then return the empty byte sequence.
|
||||
if (es_array_buffer->is_detached())
|
||||
return {};
|
||||
return ByteBuffer {};
|
||||
|
||||
// 8. Let bytes be a new byte sequence of length equal to length.
|
||||
auto bytes = ByteBuffer::create_zeroed(length);
|
||||
|
|
Loading…
Add table
Reference in a new issue