1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibJS: Convert to_index() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-18 00:05:01 +03:00
parent aad12b050b
commit 85a28a6555
7 changed files with 25 additions and 40 deletions

View file

@ -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.