From 686e3a0d94f48dd3df98b09458f9916f5b0dddf8 Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Wed, 29 Mar 2023 23:17:47 +0100 Subject: [PATCH] LibWeb: Support returning a callback function in IDL --- .../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 958eddc946..3f3d5259a6 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -122,6 +122,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 (interface.callback_functions.contains(type.name())) + return { .name = "JS::Handle", .sequence_storage_type = SequenceStorageType::MarkedVector }; + if (type.is_string()) { if (interface.extended_attributes.contains("UseNewAKString")) return { .name = "String", .sequence_storage_type = SequenceStorageType::Vector };