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.
This commit is contained in:
Kenneth Myhra 2023-03-05 20:46:16 +01:00 committed by Linus Groh
parent 1ef03c9cc5
commit 680e970597
Notes: sideshowbarker 2024-07-17 03:59:29 +09:00

View file

@ -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);
}
}