mrbkap's patch for 418293 with a few nits picked, r=me, a=beltzner.

This commit is contained in:
brendan%mozilla.org 2008-03-03 07:10:18 +00:00
Родитель cdec089240
Коммит 79bcd30f27
1 изменённых файлов: 30 добавлений и 9 удалений

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

@ -1085,11 +1085,32 @@ JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp)
JS_PUBLIC_API(JSObject *) JS_PUBLIC_API(JSObject *)
JS_GetFrameThis(JSContext *cx, JSStackFrame *fp) JS_GetFrameThis(JSContext *cx, JSStackFrame *fp)
{ {
if (!fp->thisp && fp->argv) { JSStackFrame *afp;
fp->thisp = js_ComputeThis(cx, JS_TRUE, fp->argv);
if (!fp->thisp) if (fp->flags & JSFRAME_COMPUTED_THIS)
return NULL; return fp->thisp;
/* js_ComputeThis gets confused if fp != cx->fp, so set it aside. */
if (cx->fp != fp) {
afp = cx->fp;
if (afp) {
afp->dormantNext = cx->dormantFrameChain;
cx->dormantFrameChain = afp;
cx->fp = fp;
}
} else {
afp = NULL;
} }
if (!fp->thisp && fp->argv)
fp->thisp = js_ComputeThis(cx, JS_TRUE, fp->argv);
if (afp) {
cx->fp = afp;
cx->dormantFrameChain = afp->dormantNext;
afp->dormantNext = NULL;
}
return fp->thisp; return fp->thisp;
} }
@ -1670,9 +1691,9 @@ JS_SetContextDebugHooks(JSContext *cx, JSDebugHooks *hooks)
#ifdef MOZ_SHARK #ifdef MOZ_SHARK
JS_PUBLIC_API(JSBool) JS_PUBLIC_API(JSBool)
JS_StartChudRemote() JS_StartChudRemote()
{ {
if (chudIsRemoteAccessAcquired() && if (chudIsRemoteAccessAcquired() &&
(chudStartRemotePerfMonitor("Mozilla") == chudSuccess)) { (chudStartRemotePerfMonitor("Mozilla") == chudSuccess)) {
return JS_TRUE; return JS_TRUE;
} }
@ -1730,7 +1751,7 @@ js_StopShark(JSContext *cx, JSObject *obj,
if (!JS_StopChudRemote()) { if (!JS_StopChudRemote()) {
JS_ReportError(cx, "Error stopping CHUD."); JS_ReportError(cx, "Error stopping CHUD.");
} }
return JS_TRUE; return JS_TRUE;
} }
@ -1741,7 +1762,7 @@ js_ConnectShark(JSContext *cx, JSObject *obj,
if (!JS_ConnectShark()) { if (!JS_ConnectShark()) {
JS_ReportError(cx, "Error connecting to Shark."); JS_ReportError(cx, "Error connecting to Shark.");
} }
return JS_TRUE; return JS_TRUE;
} }
@ -1752,7 +1773,7 @@ js_DisconnectShark(JSContext *cx, JSObject *obj,
if (!JS_DisconnectShark()) { if (!JS_DisconnectShark()) {
JS_ReportError(cx, "Error disconnecting from Shark."); JS_ReportError(cx, "Error disconnecting from Shark.");
} }
return JS_TRUE; return JS_TRUE;
} }