From e1234924703af31b65bf82191a5c2bd2604b5d3d Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 9 Sep 2023 13:23:38 +1200 Subject: [PATCH] LibWeb: Allow ArrayBuffer attributes to be used in IDL The FileReader IDL has the following entry: ``` readonly attribute (DOMString or ArrayBuffer)? result; ``` This change supports the use ArrayBuffer as a JS built-in in this definition. --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index a39e877cbc..10d9b88a76 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -131,6 +131,9 @@ CppType idl_type_name_to_cpp_type(Type const& type, Interface const& interface) if (is_platform_object(type)) return { .name = DeprecatedString::formatted("JS::Handle<{}>", type.name()), .sequence_storage_type = SequenceStorageType::MarkedVector }; + if (is_javascript_builtin(type)) + return { .name = DeprecatedString::formatted("JS::Handle", type.name()), .sequence_storage_type = SequenceStorageType::MarkedVector }; + if (interface.callback_functions.contains(type.name())) return { .name = "JS::Handle", .sequence_storage_type = SequenceStorageType::MarkedVector };