mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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
Notes:
sideshowbarker
2024-07-18 02:45:02 +09:00
Author: https://github.com/trflynn89
Commit: ff66218631
Pull-request: https://github.com/SerenityOS/serenity/pull/10462
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"~~~(
|
scoped_generator.append(R"~~~(
|
||||||
else
|
else
|
||||||
@cpp_name@ = JS::js_null();
|
@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 {
|
} else {
|
||||||
TODO();
|
TODO();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue