mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibJS: Convert to_index() to ThrowCompletionOr
This commit is contained in:
parent
aad12b050b
commit
85a28a6555
7 changed files with 25 additions and 40 deletions
|
@ -58,9 +58,7 @@ static ThrowCompletionOr<size_t> validate_atomic_access(GlobalObject& global_obj
|
|||
auto length = typed_array.array_length();
|
||||
|
||||
// 2. Let accessIndex be ? ToIndex(requestIndex).
|
||||
auto access_index = request_index.to_index(global_object);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto access_index = TRY(request_index.to_index(global_object));
|
||||
|
||||
// 3. Assert: accessIndex ≥ 0.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue