mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1298776 - Handle nullptr return from CreatePromiseObjectInternal in PromiseObject::create. r=evilpie
MozReview-Commit-ID: Hp6Y7yrOQBk
This commit is contained in:
parent
5660fcb461
commit
cbb0ee47c1
@ -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))
|
||||
|
1
js/src/jit-test/tests/promise/bug-1298776.js
Normal file
1
js/src/jit-test/tests/promise/bug-1298776.js
Normal file
@ -0,0 +1 @@
|
||||
oomTest(Function(`new Promise(res=>res)`));
|
Loading…
Reference in New Issue
Block a user