diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 03e027ef723..ae2efb45d04 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -1030,12 +1030,12 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter if (!@js_name@@js_suffix@.is_object()) return vm.throw_completion(JS::ErrorType::NotAnObject, @js_name@@js_suffix@.to_string_without_side_effects()); - auto iterator_method@recursion_depth@ = TRY(@js_name@@js_suffix@.get_method(vm, vm.well_known_symbol_iterator())); - if (!iterator_method@recursion_depth@) + auto @js_name@@js_suffix@_iterator_method@recursion_depth@ = TRY(@js_name@@js_suffix@.get_method(vm, vm.well_known_symbol_iterator())); + if (!@js_name@@js_suffix@_iterator_method@recursion_depth@) return vm.throw_completion(JS::ErrorType::NotIterable, @js_name@@js_suffix@.to_string_without_side_effects()); )~~~"); - parameterized_type.generate_sequence_from_iterable(sequence_generator, ByteString::formatted("{}{}", acceptable_cpp_name, optional ? "_non_optional" : ""), ByteString::formatted("{}{}", js_name, js_suffix), ByteString::formatted("iterator_method{}", recursion_depth), interface, recursion_depth + 1); + parameterized_type.generate_sequence_from_iterable(sequence_generator, ByteString::formatted("{}{}", acceptable_cpp_name, optional ? "_non_optional" : ""), ByteString::formatted("{}{}", js_name, js_suffix), ByteString::formatted("{}{}_iterator_method{}", js_name, js_suffix, recursion_depth), interface, recursion_depth + 1); if (optional) { sequence_generator.append(R"~~~( @@ -1699,7 +1699,7 @@ void IDL::ParameterizedType::generate_sequence_from_iterable(SourceGenerator& ge // FIXME: The WebIDL spec is out of date - it should be using GetIteratorFromMethod. sequence_generator.append(R"~~~( - auto iterator@recursion_depth@ = TRY(JS::get_iterator_from_method(vm, @iterable_cpp_name@, *@iterator_method_cpp_name@)); + auto @iterable_cpp_name@_iterator@recursion_depth@ = TRY(JS::get_iterator_from_method(vm, @iterable_cpp_name@, *@iterator_method_cpp_name@)); )~~~"); if (sequence_cpp_type.sequence_storage_type == SequenceStorageType::Vector) { @@ -1714,7 +1714,7 @@ void IDL::ParameterizedType::generate_sequence_from_iterable(SourceGenerator& ge sequence_generator.append(R"~~~( for (;;) { - auto next@recursion_depth@ = TRY(JS::iterator_step(vm, iterator@recursion_depth@)); + auto next@recursion_depth@ = TRY(JS::iterator_step(vm, @iterable_cpp_name@_iterator@recursion_depth@)); if (!next@recursion_depth@) break;