mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
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.
This commit is contained in:
parent
72a48ee1ee
commit
99f094905e
Notes:
sideshowbarker
2024-07-17 08:25:15 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/99f094905e Pull-request: https://github.com/SerenityOS/serenity/pull/17614 Reviewed-by: https://github.com/linusg ✅
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue