From bed9b485be2791a43e48eadaa304055a6eb47ea2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 3 Apr 2014 23:32:11 -0400 Subject: [PATCH] Bug 991753. Make sure we're in the right compartment before we try wrapping our Promise in Promise::GetOrCreateWrapper. r=bholley --- dom/promise/Promise.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp index 23ea7f5de5a..5941f160e58 100644 --- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -254,6 +254,8 @@ Promise::GetOrCreateWrapper(JSContext* aCx) return nullptr; } + JSAutoCompartment ac(aCx, scope); + JS::Rooted val(aCx); if (!WrapNewBindingObject(aCx, scope, this, &val)) { MOZ_ASSERT(JS_IsExceptionPending(aCx));