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));