mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +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
|
@ -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