From 5f993eecdbbd95c006ff542dfbb96341b9ee3f59 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 14 Dec 2021 19:49:15 +0000 Subject: [PATCH] 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, so we accidentally started returning an empty Optional instead. Explicitly specify the constructor name to fix this. Thanks to DexesTTP for catching this! --- Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.cpp b/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.cpp index 54eb79a94f..cc0888e5e2 100644 --- a/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.cpp @@ -105,7 +105,7 @@ Optional 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);