mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-16 06:22:17 +00:00
LibWeb/IDL: Add support for optional long long
This commit is contained in:
parent
028c26df76
commit
f4cbafe951
Notes:
sideshowbarker
2024-07-17 17:06:59 +09:00
Author: https://github.com/kennethmyhra
Commit: f4cbafe951
Pull-request: https://github.com/SerenityOS/serenity/pull/14563
Reviewed-by: https://github.com/Lubrsi
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg ✅
1 changed files with 24 additions and 0 deletions
|
@ -518,6 +518,30 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
|||
scoped_generator.append(R"~~~(
|
||||
else
|
||||
@cpp_name@ = @parameter.optional_default_value@L;
|
||||
)~~~");
|
||||
}
|
||||
} else if (parameter.type->name == "long long") {
|
||||
if (!optional || optional_default_value.has_value()) {
|
||||
scoped_generator.append(R"~~~(
|
||||
i64 @cpp_name@;
|
||||
)~~~");
|
||||
} else {
|
||||
scoped_generator.append(R"~~~(
|
||||
Optional<i64> @cpp_name@;
|
||||
)~~~");
|
||||
}
|
||||
if (optional) {
|
||||
scoped_generator.append(R"~~~(
|
||||
if (!@js_name@@js_suffix@.is_undefined())
|
||||
)~~~");
|
||||
}
|
||||
scoped_generator.append(R"~~~(
|
||||
@cpp_name@ = TRY(@js_name@@js_suffix@.to_bigint_int64(global_object));
|
||||
)~~~");
|
||||
if (optional_default_value.has_value()) {
|
||||
scoped_generator.append(R"~~~(
|
||||
else
|
||||
@cpp_name@ = @parameter.optional_default_value@L;
|
||||
)~~~");
|
||||
}
|
||||
} else if (parameter.type->name == "Promise") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue