From 4791f9e88f1a17068adc81bfa2a7b99942c455df Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 18 Aug 2025 17:27:10 +0100 Subject: [PATCH] IDLGenerators: Make attribute names C++-safe --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 1bd580abeb4..0e97270a528 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -3231,7 +3231,7 @@ static void collect_attribute_values_of_an_inheritance_stack(SourceGenerator& fu auto implemented_as = attribute.extended_attributes.get("ImplementedAs").value(); attribute_generator.set("attribute.cpp_name", implemented_as); } else { - attribute_generator.set("attribute.cpp_name", attribute.name.to_snakecase()); + attribute_generator.set("attribute.cpp_name", make_input_acceptable_cpp(attribute.name.to_snakecase())); } if (attribute.extended_attributes.contains("Reflect")) { @@ -3898,7 +3898,7 @@ static void generate_prototype_or_global_mixin_definitions(IDL::Interface const& auto implemented_as = attribute.extended_attributes.get("ImplementedAs").value(); attribute_generator.set("attribute.cpp_name", implemented_as); } else { - attribute_generator.set("attribute.cpp_name", attribute.name.to_snakecase()); + attribute_generator.set("attribute.cpp_name", make_input_acceptable_cpp(attribute.name.to_snakecase())); } if (attribute.extended_attributes.contains("Reflect")) {