From 680e970597aa292a20fa4e24f6f5c0a905f50c72 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sun, 5 Mar 2023 20:46:16 +0100 Subject: [PATCH] LibWeb: Move generated #include statement for iterators out of loop When an IDL file has #imports and the IDL interface exposes an iterator, the bindings generator would generate #include statements missing the class name of the iterator in the form 'LibWeb/{namespace}/Iterator'. This change only generates the iterator #include statement for the top interface that is the iterator. --- .../LibWeb/BindingsGenerator/IDLGenerators.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 68b0439c3d..ab34e736fb 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -248,11 +248,11 @@ static void emit_includes_for_all_imports(auto& interface, auto& generator, bool continue; generate_include_for(generator, interface->module_own_path); + } - if (is_iterator) { - auto iterator_path = DeprecatedString::formatted("{}Iterator", interface->fully_qualified_name.replace("::"sv, "/"sv, ReplaceMode::All)); - generate_include_for_iterator(generator, iterator_path); - } + if (is_iterator) { + auto iterator_path = DeprecatedString::formatted("{}Iterator", interface.fully_qualified_name.replace("::"sv, "/"sv, ReplaceMode::All)); + generate_include_for_iterator(generator, iterator_path); } }