bug 580128 - Find the true caller through the wrappers. r=jst

This commit is contained in:
Blake Kaplan 2010-10-10 15:36:01 -07:00
Родитель a943fb0e00
Коммит c00723aef7
1 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -5573,8 +5573,24 @@ nsGlobalWindow::CallerInnerWindow()
return nsnull;
}
JSObject *scope = ::JS_GetScopeChain(cx);
JSObject *scope = nsnull;
JSStackFrame *fp = nsnull;
JS_FrameIterator(cx, &fp);
if (fp) {
while (fp->isDummyFrame()) {
if (!JS_FrameIterator(cx, &fp))
break;
}
if (fp)
scope = &fp->scopeChain();
}
if (!scope)
scope = JS_GetScopeChain(cx);
JSAutoEnterCompartment ac;
if (!ac.enter(cx, scope))
return nsnull;
nsCOMPtr<nsIXPConnectWrappedNative> wrapper;