mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:57:42 +00:00
LibJS: Convert to_i32() to ThrowCompletionOr
This commit is contained in:
parent
20d990563c
commit
f6a5ff7b00
11 changed files with 47 additions and 61 deletions
|
@ -1129,9 +1129,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
|||
)~~~");
|
||||
} else if (parameter.type->name == "long") {
|
||||
scoped_generator.append(R"~~~(
|
||||
auto @cpp_name@ = @js_name@@js_suffix@.to_i32(global_object);
|
||||
if (vm.exception())
|
||||
@return_statement@
|
||||
auto @cpp_name@ = TRY_OR_DISCARD(@js_name@@js_suffix@.to_i32(global_object));
|
||||
)~~~");
|
||||
} else if (parameter.type->name == "EventHandler") {
|
||||
// x.onfoo = function() { ... }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue