Bug 450692 - Don't unconditionally add inner and outer object hooks to XPConnect objects.
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 15 Sep 2008 17:14:08 -0700
changeset 19279 78c6d65de4966731a98c4106e1703178fd5dfc8f
parent 19278 3d6c1f87701d907780ceb58b61d33645a629f0ad
child 19280 da539de11534af7950027f741ddc72d4afa7496e
push id2086
push usermrbkap@mozilla.com
push dateTue, 16 Sep 2008 00:14:31 +0000
treeherdermozilla-central@78c6d65de496 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs450692
milestone1.9.1b1pre
Bug 450692 - Don't unconditionally add inner and outer object hooks to XPConnect objects.
js/src/xpconnect/src/xpcwrappednativejsops.cpp
--- a/js/src/xpconnect/src/xpcwrappednativejsops.cpp
+++ b/js/src/xpconnect/src/xpcwrappednativejsops.cpp
@@ -1441,19 +1441,23 @@ XPCNativeScriptableShared::PopulateJSCla
     if(mFlags.WantHasInstance())
         mJSClass.base.hasInstance = XPC_WN_Helper_HasInstance;
 
     if(mFlags.WantTrace())
         mJSClass.base.mark = JS_CLASS_TRACE(XPC_WN_Helper_Trace);
     else
         mJSClass.base.mark = JS_CLASS_TRACE(XPC_WN_Shared_Trace);
 
+    // Equality is a required hook.
     mJSClass.equality = XPC_WN_Equality;
-    mJSClass.outerObject = XPC_WN_OuterObject;
-    mJSClass.innerObject = XPC_WN_InnerObject;
+
+    if(mFlags.WantOuterObject())
+        mJSClass.outerObject = XPC_WN_OuterObject;
+    if(mFlags.WantInnerObject())
+        mJSClass.innerObject = XPC_WN_InnerObject;
 }
 
 /***************************************************************************/
 /***************************************************************************/
 
 JSBool
 XPC_WN_CallMethod(JSContext *cx, JSObject *obj,
                   uintN argc, jsval *argv, jsval *vp)