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:
parent
96bb250a4a
commit
3b577e6135
Notes:
github-actions[bot]
2025-02-18 17:19:50 +00:00
Author: https://github.com/Psychpsyo
Commit: 3b577e6135
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3548
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/Lubrsi
Reviewed-by: https://github.com/shannonbooth
1 changed files with 1 additions and 1 deletions
|
@ -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"~~~(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue