1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 17:44:56 +09:00

Meta: Improve IDL generator for dictionary members

This makes it so that the IDL generator no longer assumed that
dictionary members with a default value are optional, since they
will always, at least, have the default value.
This commit is contained in:
Psychpsyo 2025-02-12 17:26:11 +01:00 committed by Andrew Kaster
parent 96bb250a4a
commit 3b577e6135
Notes: github-actions[bot] 2025-02-18 17:19:50 +00:00

View file

@ -950,7 +950,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
bool may_be_null = !optional_default_value.has_value() || parameter.type->is_nullable() || optional_default_value.value() == "null";
// Required dictionary members cannot be null.
may_be_null &= !member.required;
may_be_null &= !member.required && !member.default_value.has_value();
if (member.type->is_string() && optional && may_be_null) {
dictionary_generator.append(R"~~~(