IDLGenerators: Unbreak sequence<dictionary> 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.
This commit is contained in:
Ali Mohammad Pur 2025-04-22 09:50:05 +02:00 committed by Andrew Kaster
commit 3a6b6a732e
Notes: github-actions[bot] 2025-04-22 14:45:19 +00:00

View file

@ -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"~~~(