summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-10-20 08:56:01 -0400
committerLinus Groh <mail@linusgroh.de>2021-10-21 00:26:45 +0100
commit8be1caa05d57c2571e9215875b0e5e6dd7b7845a (patch)
treefb32324fce3c46af85ccef066635fe2d5a22746e /Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
parentc981d7b9bd211bd3d5e61951395b278e95ae1a9b (diff)
downloadserenity-8be1caa05d57c2571e9215875b0e5e6dd7b7845a.zip
LibJS: Convert IteratorStep AO to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp5
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);