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

@ -948,10 +948,8 @@ ExtendableEvent::GetPromise()
}
JSContext* cx = jsapi.cx();
GlobalObject global(cx, globalObj->GetGlobalJSObject());
ErrorResult result;
RefPtr<Promise> p = Promise::All(global, Move(mPromises), result);
RefPtr<Promise> p = Promise::All(cx, Move(mPromises), result);
if (NS_WARN_IF(result.MaybeSetPendingException(cx))) {
return nullptr;
}