merge
authorDão Gottwald <dao@mozilla.com>
Thu, 11 Jun 2009 10:44:27 +0200
changeset 25931 b3058f6658ec3072a22402db5a8424c837a467d9
parent 25930 c1bb1dfd7a153ca9ed8d2eba812a5303832a4cc8 (current diff)
parent 25924 1541e172b6f2eab564bb072b69694f54486dac06 (diff)
child 25932 9d187f786ebb9f474224c0a22f8b0df56282deea
push id1677
push userdgottwald@mozilla.com
push dateThu, 11 Jun 2009 08:44:57 +0000
milestone1.9.1pre
merge
--- 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