From 948fa12cc47e2774eeb0d32b28aebde143ca5577 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Fri, 24 Sep 2010 23:49:58 -0700 Subject: [PATCH] Bug 580128 - Use compartments instead of global objects to see if we should use slim wrappers. r=peterv --- js/src/xpconnect/src/xpcconvert.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/xpconnect/src/xpcconvert.cpp b/js/src/xpconnect/src/xpcconvert.cpp index c881d769ccd6..a07a8b6d0529 100644 --- a/js/src/xpconnect/src/xpcconvert.cpp +++ b/js/src/xpconnect/src/xpcconvert.cpp @@ -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;