diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index e8b8da0669..e31f398469 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -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); |