Bug 497102 - Add missing call. r+sr=bzbarsky
authormrbkap@gmail.com
Thu, 11 Jun 2009 11:39:06 +0300
changeset 25924 1541e172b6f2eab564bb072b69694f54486dac06
parent 25923 a339028e68c3cf59adb484e714fb65bcdaadfa5b
child 25931 b3058f6658ec3072a22402db5a8424c837a467d9
push id1676
push useropettay@mozilla.com
push dateThu, 11 Jun 2009 08:39:44 +0000
bugs497102
milestone1.9.1pre
Bug 497102 - Add missing call. r+sr=bzbarsky
dom/src/base/nsDOMClassInfo.cpp
--- a/dom/src/base/nsDOMClassInfo.cpp
+++ b/dom/src/base/nsDOMClassInfo.cpp
@@ -4705,16 +4705,27 @@ nsWindowSH::GetProperty(nsIXPConnectWrap
       // check and return.
 
       nsGlobalWindow *frameWin = (nsGlobalWindow *)frame.get();
 
       nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
       rv = WrapNative(cx, frameWin->GetGlobalJSObject(), frame,
                       &NS_GET_IID(nsIDOMWindow), vp,
                       getter_AddRefs(holder));
+
+      if (NS_SUCCEEDED(rv) && !win->IsChromeWindow()) {
+        JSObject *scopeobj = JS_GetScopeChain(cx);
+        if (!scopeobj) {
+          *_retval = JS_FALSE;
+          return NS_ERROR_FAILURE;
+        }
+
+        rv = sXPConnect->GetXOWForObject(cx, scopeobj, JSVAL_TO_OBJECT(*vp),
+                                         vp);
+      }
     }
 
     return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
   }
 
   if (JSVAL_IS_STRING(id) && !JSVAL_IS_PRIMITIVE(*vp) &&
       ::JS_TypeOfValue(cx, *vp) != JSTYPE_FUNCTION) {
     // A named property accessed which could have been resolved to a