diff --git a/js/xpconnect/wrappers/ChromeObjectWrapper.cpp b/js/xpconnect/wrappers/ChromeObjectWrapper.cpp index dd4f02817431..a4f6c372a9b0 100644 --- a/js/xpconnect/wrappers/ChromeObjectWrapper.cpp +++ b/js/xpconnect/wrappers/ChromeObjectWrapper.cpp @@ -34,7 +34,7 @@ ChromeObjectWrapper::getPropertyDescriptor(JSContext *cx, JSObject *wrapper, return true; // If not, try doing the lookup on the prototype. - JSAutoCompartment ac(cx, wrapper); + JS_ASSERT(js::IsObjectInContextCompartment(wrapper, cx)); return JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, desc); } @@ -51,7 +51,7 @@ ChromeObjectWrapper::has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) return true; // Try the prototype if that failed. - JSAutoCompartment ac(cx, wrapper); + JS_ASSERT(js::IsObjectInContextCompartment(wrapper, cx)); JSPropertyDescriptor desc; if (!JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, &desc)) return false; @@ -73,7 +73,7 @@ ChromeObjectWrapper::get(JSContext *cx, JSObject *wrapper, JSObject *receiver, return true; // Try the prototype. - JSAutoCompartment ac(cx, wrapper); + JS_ASSERT(js::IsObjectInContextCompartment(wrapper, cx)); return js::GetGeneric(cx, wrapperProto, receiver, id, vp); }