From 3a6b6a732e1e4c956899d322c9f4249dd9fb9af7 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 22 Apr 2025 09:50:05 +0200 Subject: [PATCH] IDLGenerators: Unbreak sequence codegen This was completely busted (where it would generate a variable inside a block, and try to access it outside the block); this commit fixes this in the least annoying way possible. --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 55733767d77..bf4ea033228 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -1859,7 +1859,8 @@ static void generate_wrap_statement(SourceGenerator& generator, ByteString const auto* wrapped_element@recursion_depth@ = &(*element@recursion_depth@); )~~~"); } else { - generate_wrap_statement(scoped_generator, ByteString::formatted("element{}", recursion_depth), sequence_generic_type.parameters().first(), interface, ByteString::formatted("auto wrapped_element{} =", recursion_depth), WrappingReference::Yes, recursion_depth + 1); + scoped_generator.append("JS::Value wrapped_element@recursion_depth@;\n"sv); + generate_wrap_statement(scoped_generator, ByteString::formatted("element{}", recursion_depth), sequence_generic_type.parameters().first(), interface, ByteString::formatted("wrapped_element{} =", recursion_depth), WrappingReference::Yes, recursion_depth + 1); } scoped_generator.append(R"~~~(