From 007258169387f3927371ce30f8599560e3c7bae0 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Thu, 15 Apr 2021 20:32:15 +0300 Subject: [PATCH] LibWeb: Emit optional boolean variable definition in WrapperGenerator The removed if in this commit was inside the else branch of an if with the same condition, making it a no-op, as well as breaking optional booleans. --- Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp b/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp index 555e0d4c58..42b5bb7d3b 100644 --- a/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp +++ b/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp @@ -615,11 +615,9 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter bool @cpp_name@; )~~~"); } else { - if (!optional_default_value.is_null()) { - scoped_generator.append(R"~~~( + scoped_generator.append(R"~~~( Optional @cpp_name@; )~~~"); - } } scoped_generator.append(R"~~~( if (!@js_name@@js_suffix@.is_undefined())