LibWeb/Bindings: Add a forward declaration of generate_to_cpp

generate_to_cpp is called recursively, such as when generating
dictionary values. To support factoring this (massive) function
into functions, add a forward declaration.
This commit is contained in:
Shannon Booth
2026-03-19 19:29:53 +01:00
committed by Jelle Raaijmakers
parent 92f4fc2cb9
commit f04e7d88d5
Notes: github-actions[bot] 2026-03-19 21:15:53 +00:00

View File

@@ -24,6 +24,9 @@ namespace IDL {
Vector<StringView> g_header_search_paths;
template<typename ParameterType>
static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter, ByteString const& js_name, ByteString const& js_suffix, ByteString const& cpp_name, IDL::Interface const& interface, bool legacy_null_to_empty_string = false, bool optional = false, Optional<ByteString> optional_default_value = {}, bool variadic = false, size_t recursion_depth = 0);
// FIXME: Generate this automatically somehow.
static bool is_platform_object(Type const& type)
{
@@ -661,7 +664,7 @@ static void generate_to_integral(SourceGenerator& scoped_generator, ParameterTyp
}
template<typename ParameterType>
static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter, ByteString const& js_name, ByteString const& js_suffix, ByteString const& cpp_name, IDL::Interface const& interface, bool legacy_null_to_empty_string = false, bool optional = false, Optional<ByteString> optional_default_value = {}, bool variadic = false, size_t recursion_depth = 0)
static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter, ByteString const& js_name, ByteString const& js_suffix, ByteString const& cpp_name, IDL::Interface const& interface, bool legacy_null_to_empty_string, bool optional, Optional<ByteString> optional_default_value, bool variadic, size_t recursion_depth)
{
auto scoped_generator = generator.fork();
auto acceptable_cpp_name = make_input_acceptable_cpp(cpp_name);