Bug 1453339 - Make it harder to mess up Promise::All. r=peterv, a=RyanVM

MozReview-Commit-ID: UO4wssYHj7
This commit is contained in:
Boris Zbarsky 2018-04-12 23:26:44 -04:00 committed by Roy Tam
commit 72c04aea04
5 changed files with 29 additions and 35 deletions

View file

@ -343,17 +343,7 @@ FontFaceSet::Load(JSContext* aCx,
}
}
nsIGlobalObject* globalObject = GetParentObject();
if (!globalObject) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
JS::Rooted<JSObject*> jsGlobal(aCx, globalObject->GetGlobalJSObject());
GlobalObject global(aCx, jsGlobal);
RefPtr<Promise> result = Promise::All(global, promises, aRv);
return result.forget();
return Promise::All(aCx, promises, aRv);
}
bool