LibJS: Convert to_index() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-18 00:05:01 +03:00
commit 85a28a6555
Notes: sideshowbarker 2024-07-18 02:12:11 +09:00
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.