mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
IDLGenerators: Do not emit null literals as default values
This commit is contained in:
parent
fe40bdfc01
commit
82c36b303c
Notes:
sideshowbarker
2024-07-17 01:10:58 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/82c36b303c Pull-request: https://github.com/SerenityOS/serenity/pull/21893
1 changed files with 2 additions and 2 deletions
|
@ -439,7 +439,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
|||
@parameter.type.name@ @cpp_name@ = TRY(@js_name@@js_suffix@.to_double(vm));
|
||||
)~~~");
|
||||
} else {
|
||||
if (optional_default_value.has_value()) {
|
||||
if (optional_default_value.has_value() && optional_default_value != "null"sv) {
|
||||
scoped_generator.append(R"~~~(
|
||||
@parameter.type.name@ @cpp_name@;
|
||||
)~~~");
|
||||
|
@ -452,7 +452,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
|||
if (!@js_name@@js_suffix@.is_undefined())
|
||||
@cpp_name@ = TRY(@js_name@@js_suffix@.to_double(vm));
|
||||
)~~~");
|
||||
if (optional_default_value.has_value()) {
|
||||
if (optional_default_value.has_value() && optional_default_value.value() != "null"sv) {
|
||||
scoped_generator.append(R"~~~(
|
||||
else
|
||||
@cpp_name@ = @parameter.optional_default_value@;
|
||||
|
|
Loading…
Reference in a new issue