1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibJS: Convert IteratorStep AO to ThrowCompletionOr

This commit is contained in:
Timothy Flynn 2021-10-20 08:56:01 -04:00 committed by Linus Groh
parent c981d7b9bd
commit 8be1caa05d
7 changed files with 12 additions and 20 deletions

View file

@ -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);