mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +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
|
@ -127,7 +127,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::from_code_point)
|
|||
vm.throw_exception<RangeError>(global_object, ErrorType::InvalidCodePoint, next_code_point.to_string_without_side_effects());
|
||||
return {};
|
||||
}
|
||||
auto code_point = next_code_point.to_i32(global_object);
|
||||
auto code_point = TRY_OR_DISCARD(next_code_point.to_i32(global_object));
|
||||
if (code_point < 0 || code_point > 0x10FFFF) {
|
||||
vm.throw_exception<RangeError>(global_object, ErrorType::InvalidCodePoint, next_code_point.to_string_without_side_effects());
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue