summaryrefslogtreecommitdiff
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index 6c10eba821..fc013c14cb 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -4902,11 +4902,14 @@ JS_PUBLIC_API(JSObject*)
JS::NewPromiseObject(JSContext* cx, HandleObject executor, HandleObject proto /* = nullptr */)
{
MOZ_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
- MOZ_ASSERT(IsCallable(executor));
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, executor, proto);
+ if (!executor)
+ return PromiseObject::createSkippingExecutor(cx);
+
+ MOZ_ASSERT(IsCallable(executor));
return PromiseObject::create(cx, executor, proto);
}