Bug 580128 - Use compartments instead of global objects to see if we should use slim wrappers. r=peterv

This commit is contained in:
Blake Kaplan 2010-09-24 23:49:58 -07:00
parent bdb04e3dcc
commit 948fa12cc4

View File

@ -1193,8 +1193,8 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx,
}
else if(IS_SLIM_WRAPPER_OBJECT(flat))
{
JSObject* global = JS_GetGlobalForObject(cx, flat);
if(global == xpcscope->GetGlobalJSObject())
if(flat->getCompartment(cx) ==
xpcscope->GetGlobalJSObject()->getCompartment(cx))
{
*d = OBJECT_TO_JSVAL(flat);
return JS_TRUE;