mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 09:35:15 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user