mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS: Convert to_index() to ThrowCompletionOr
This commit is contained in:
parent
aad12b050b
commit
85a28a6555
Notes:
sideshowbarker
2024-07-18 02:12:11 +09:00
Author: https://github.com/IdanHo
Commit: 85a28a6555
Pull-request: https://github.com/SerenityOS/serenity/pull/10522
Reviewed-by: https://github.com/linusg ✅
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