浏览代码

LibWeb: Support returning a callback function in IDL

Luke Wilde 2 年之前
父节点
当前提交
686e3a0d94
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp

+ 3 - 0
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<WebIDL::CallbackType>", .sequence_storage_type = SequenceStorageType::MarkedVector };
+
     if (type.is_string()) {
         if (interface.extended_attributes.contains("UseNewAKString"))
             return { .name = "String", .sequence_storage_type = SequenceStorageType::Vector };