1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator
Matthew Olsson e03e710d1b IDLGenerators: Support nullable dictionary members with default values
When wrapping dictionary members, generate_wrap_statement was called
with the pattern "auto {} = ...", where "..." was determined based on
the variable's type. However, in generate_wrap_statement, if a type is
nullable it generates an if statement, so this would end up generating
something along the lines of

    if (!retval.member.has_value()) {
    	auto wrapped_member0_value = JS::js_null();
    } else {
    	auto wrapped_member0_value = JS::Value(...);
    }

...which makes the declaration inaccessible. It now generates the same
code, but the "auto" declaration (now an explicit JS::Value declaration)
is outside of the if-statement.
2023-11-08 09:58:18 +01:00
..
CMakeLists.txt BindingsGenerator: Write generated code to disk instead of stdout 2022-12-13 11:31:24 +01:00
IDLGenerators.cpp IDLGenerators: Support nullable dictionary members with default values 2023-11-08 09:58:18 +01:00
main.cpp BindingsGenerator: Only truncate generated files if they have changed 2023-08-04 10:06:41 -06:00
Namespaces.h LibWeb: Add MathML Namespace to IDL Generator 2023-08-12 07:59:23 +01:00