diff options
author | Boris Zbarsky <bzbarsky@mit.edu> | 2018-04-12 23:26:44 -0400 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-04-19 12:05:25 +0200 |
commit | 3b4a81565780b724841c2950513416f14ab95ff3 (patch) | |
tree | 4a79368d1e44d3fa573937edc85256a865e71ad4 /dom/promise/Promise.h | |
parent | ddbe089a628df4b3f818211aacf3b776dfa31dff (diff) | |
download | uxp-3b4a81565780b724841c2950513416f14ab95ff3.tar.gz |
Bug 1453339 - Make it harder to mess up Promise::All. r=peterv, a=RyanVM
MozReview-Commit-ID: UO4wssYHj7
Diffstat (limited to 'dom/promise/Promise.h')
-rw-r--r-- | dom/promise/Promise.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/dom/promise/Promise.h b/dom/promise/Promise.h index f2ad3bd6c1..642603a11c 100644 --- a/dom/promise/Promise.h +++ b/dom/promise/Promise.h @@ -188,23 +188,26 @@ public: WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aWrapper); - // Do the equivalent of Promise.resolve in the current compartment of aCx. - // Errorrs are reported on the ErrorResult; if aRv comes back !Failed(), this - // function MUST return a non-null value. + // Do the equivalent of Promise.resolve in the compartment of aGlobal. The + // compartment of aCx is ignored. Errors are reported on the ErrorResult; if + // aRv comes back !Failed(), this function MUST return a non-null value. static already_AddRefed<Promise> Resolve(nsIGlobalObject* aGlobal, JSContext* aCx, JS::Handle<JS::Value> aValue, ErrorResult& aRv); - // Do the equivalent of Promise.reject in the current compartment of aCx. - // Errorrs are reported on the ErrorResult; if aRv comes back !Failed(), this - // function MUST return a non-null value. + // Do the equivalent of Promise.reject in the compartment of aGlobal. The + // compartment of aCx is ignored. Errors are reported on the ErrorResult; if + // aRv comes back !Failed(), this function MUST return a non-null value. static already_AddRefed<Promise> Reject(nsIGlobalObject* aGlobal, JSContext* aCx, JS::Handle<JS::Value> aValue, ErrorResult& aRv); + // Do the equivalent of Promise.all in the current compartment of aCx. Errors + // are reported on the ErrorResult; if aRv comes back !Failed(), this function + // MUST return a non-null value. static already_AddRefed<Promise> - All(const GlobalObject& aGlobal, - const nsTArray<RefPtr<Promise>>& aPromiseList, ErrorResult& aRv); + All(JSContext* aCx, const nsTArray<RefPtr<Promise>>& aPromiseList, + ErrorResult& aRv); void Then(JSContext* aCx, |