1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:17:44 +00:00

LibJS: Call resolve instead of reject in AsyncFromSyncIteratorPrototype

This commit is contained in:
davidot 2022-08-31 17:41:41 +02:00 committed by Linus Groh
parent 3b1c3e574f
commit fb61e9274a
2 changed files with 25 additions and 1 deletions

View file

@ -118,7 +118,7 @@ JS_DEFINE_NATIVE_FUNCTION(AsyncFromSyncIteratorPrototype::return_)
auto* iter_result = create_iterator_result_object(vm, vm.argument(0), true);
// b. Perform ! Call(promiseCapability.[[Resolve]], undefined, « iterResult »).
MUST(call(vm, *promise_capability.reject, js_undefined(), iter_result));
MUST(call(vm, *promise_capability.resolve, js_undefined(), iter_result));
// c. Return promiseCapability.[[Promise]].
return promise_capability.promise;