Bug 991753. Make sure we're in the right compartment before we try wrapping our Promise in Promise::GetOrCreateWrapper. r=bholley

This commit is contained in:
Boris Zbarsky 2014-04-03 23:32:11 -04:00
parent ac98569cac
commit 6b385f0069

View File

@ -254,6 +254,8 @@ Promise::GetOrCreateWrapper(JSContext* aCx)
return nullptr; return nullptr;
} }
JSAutoCompartment ac(aCx, scope);
JS::Rooted<JS::Value> val(aCx); JS::Rooted<JS::Value> val(aCx);
if (!WrapNewBindingObject(aCx, scope, this, &val)) { if (!WrapNewBindingObject(aCx, scope, this, &val)) {
MOZ_ASSERT(JS_IsExceptionPending(aCx)); MOZ_ASSERT(JS_IsExceptionPending(aCx));