diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2023-02-25 10:16:35 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-26 00:27:22 +0100 |
commit | 99f094905e91276e3ee85b334505b3888d0f27fd (patch) | |
tree | 12a633e02ac5bc317aa39ab4d2e07fe0d7550f60 | |
parent | 72a48ee1eeb9fc7b9a874fb32a7ff7fd3a61877a (diff) | |
download | serenity-99f094905e91276e3ee85b334505b3888d0f27fd.zip |
BindingsGenerator: Conditionally check dictionary member is string
This adds the condition member.type->is_string() to the if statement, so
that we now conditionally check the dictionary member is a new string
and associated with an optional constructor parameter.
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index ca044870fc..13a6866edd 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -729,7 +729,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter } generate_to_cpp(dictionary_generator, member, member_property_value_name, "", member_value_name, interface, member.extended_attributes.contains("LegacyNullToEmptyString"), !member.required, member.default_value); - if (optional && interface.extended_attributes.contains("UseNewAKString")) { + if (member.type->is_string() && optional && interface.extended_attributes.contains("UseNewAKString")) { dictionary_generator.append(R"~~~( if (@member_value_name@.has_value()) @cpp_name@.@member_name@ = @member_value_name@.release_value(); |