Bug 1298776 - Handle nullptr return from CreatePromiseObjectInternal in PromiseObject::create. r=evilpie

MozReview-Commit-ID: Hp6Y7yrOQBk
This commit is contained in:
Till Schneidereit 2016-09-12 16:31:47 +02:00
parent 5660fcb461
commit cbb0ee47c1
2 changed files with 3 additions and 0 deletions

View File

@ -717,6 +717,8 @@ PromiseObject::create(JSContext* cx, HandleObject executor, HandleObject proto /
// Steps 3-7.
Rooted<PromiseObject*> promise(cx, CreatePromiseObjectInternal(cx, usedProto, wrappedProto));
if (!promise)
return nullptr;
RootedValue promiseVal(cx, ObjectValue(*promise));
if (wrappedProto && !cx->compartment()->wrap(cx, &promiseVal))

View File

@ -0,0 +1 @@
oomTest(Function(`new Promise(res=>res)`));