mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibWeb: Allow creating "any" types in IDL with integral default values
This enables defining "any" types in IDL files such as: any threshold = 0; This isn't able to parse decimal values yet.
This commit is contained in:
parent
b7404015aa
commit
ff66218631
1 changed files with 5 additions and 0 deletions
|
@ -1124,6 +1124,11 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
|||
scoped_generator.append(R"~~~(
|
||||
else
|
||||
@cpp_name@ = JS::js_null();
|
||||
)~~~");
|
||||
} else if (optional_default_value->to_int().has_value() || optional_default_value->to_uint().has_value()) {
|
||||
scoped_generator.append(R"~~~(
|
||||
else
|
||||
@cpp_name@ = JS::Value(@parameter.optional_default_value@);
|
||||
)~~~");
|
||||
} else {
|
||||
TODO();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue