mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibJS: Convert to_i32() to ThrowCompletionOr
This commit is contained in:
parent
20d990563c
commit
f6a5ff7b00
Notes:
sideshowbarker
2024-07-18 02:12:43 +09:00
Author: https://github.com/IdanHo
Commit: f6a5ff7b00
Pull-request: https://github.com/SerenityOS/serenity/pull/10522
Reviewed-by: https://github.com/linusg ✅
11 changed files with 47 additions and 61 deletions
|
@ -378,9 +378,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::parse_int)
|
|||
if (!s.is_empty() && (s[0] == '+' || s[0] == '-'))
|
||||
s = s.substring(1, s.length() - 1);
|
||||
|
||||
auto radix = vm.argument(1).to_i32(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto radix = TRY_OR_DISCARD(vm.argument(1).to_i32(global_object));
|
||||
|
||||
bool strip_prefix = true;
|
||||
if (radix != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue