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

LibJS: Fix incorrect is_function() check in NewPromiseCapability

I introduced this copy-paste mistake in c21255d.

Gets rid of 7 assertion failures on test262.
This commit is contained in:
Daniel Bertalan 2023-06-29 08:28:15 +02:00 committed by Andreas Kling
parent 1550e7c421
commit 18c735429f

View file

@ -96,7 +96,7 @@ ThrowCompletionOr<NonnullGCPtr<PromiseCapability>> new_promise_capability(VM& vm
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, "Promise capability resolve value");
// 8. If IsCallable(resolvingFunctions.[[Reject]]) is false, throw a TypeError exception.
if (!resolving_functions->resolve.is_function())
if (!resolving_functions->reject.is_function())
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, "Promise capability reject value");
// 9. Return the PromiseCapability Record { [[Promise]]: promise, [[Resolve]]: resolvingFunctions.[[Resolve]], [[Reject]]: resolvingFunctions.[[Reject]] }.