mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1545369 - Check for OOM in shell ReportUnhandledRejections function r=pbone
Add an error check in ReportUnhandledRejections function. Differential Revision: https://phabricator.services.mozilla.com/D28471
This commit is contained in:
parent
e240b9f36f
commit
4a5820783c
9
js/src/jit-test/tests/promise/bug-1545369.js
Normal file
9
js/src/jit-test/tests/promise/bug-1545369.js
Normal file
@ -0,0 +1,9 @@
|
||||
// |jit-test| --no-cgc; allow-oom
|
||||
|
||||
async function f(x) {
|
||||
await await x;
|
||||
};
|
||||
for (let i = 0; i < 800; ++i) {
|
||||
f();
|
||||
}
|
||||
gcparam("maxBytes", gcparam("gcBytes"));
|
@ -10663,12 +10663,12 @@ static MOZ_MUST_USE bool ReportUnhandledRejections(JSContext* cx) {
|
||||
|
||||
Rooted<SetIteratorObject*> iterObj(cx,
|
||||
&iter.toObject().as<SetIteratorObject>());
|
||||
RootedArrayObject resultObj(
|
||||
cx, &SetIteratorObject::createResult(cx)->as<ArrayObject>());
|
||||
if (!resultObj) {
|
||||
JSObject* obj = SetIteratorObject::createResult(cx);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RootedArrayObject resultObj(cx, &obj->as<ArrayObject>());
|
||||
while (true) {
|
||||
bool done = SetIteratorObject::next(iterObj, resultObj, cx);
|
||||
if (done) {
|
||||
|
Loading…
Reference in New Issue
Block a user