mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Convert IteratorStep AO to ThrowCompletionOr
This commit is contained in:
parent
c981d7b9bd
commit
8be1caa05d
Notes:
sideshowbarker
2024-07-18 02:07:07 +09:00
Author: https://github.com/trflynn89
Commit: 8be1caa05d
Pull-request: https://github.com/SerenityOS/serenity/pull/10546
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
7 changed files with 12 additions and 20 deletions
|
@ -100,11 +100,12 @@ static Value perform_promise_common(GlobalObject& global_object, Object& iterato
|
|||
size_t index = 0;
|
||||
|
||||
while (true) {
|
||||
auto* next = iterator_step(global_object, iterator_record);
|
||||
if (vm.exception()) {
|
||||
auto next_or_error = iterator_step(global_object, iterator_record);
|
||||
if (next_or_error.is_throw_completion()) {
|
||||
set_iterator_record_complete(global_object, iterator_record);
|
||||
return {};
|
||||
}
|
||||
auto* next = next_or_error.release_value();
|
||||
|
||||
if (!next) {
|
||||
set_iterator_record_complete(global_object, iterator_record);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue