mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 14:43:01 +02:00
LibJS: Convert to_u16() to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 02:12:31 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/7bbb92dfe9a Pull-request: https://github.com/SerenityOS/serenity/pull/10522 Reviewed-by: https://github.com/linusg ✅
@@ -1121,9 +1121,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
||||
)~~~");
|
||||
} else if (parameter.type->name == "unsigned short") {
|
||||
scoped_generator.append(R"~~~(
|
||||
auto @cpp_name@ = @js_name@@js_suffix@.to_u16(global_object);
|
||||
if (vm.exception())
|
||||
@return_statement@
|
||||
auto @cpp_name@ = TRY_OR_DISCARD(@js_name@@js_suffix@.to_u16(global_object));
|
||||
)~~~");
|
||||
} else if (parameter.type->name == "long") {
|
||||
scoped_generator.append(R"~~~(
|
||||
|
||||
Reference in New Issue
Block a user