зеркало из https://github.com/mozilla/pjs.git
mrbkap's patch for 418293 with a few nits picked, r=me, a=beltzner.
This commit is contained in:
Родитель
9c63da04b3
Коммит
8d22165416
|
@ -1085,11 +1085,32 @@ JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp)
|
|||
JS_PUBLIC_API(JSObject *)
|
||||
JS_GetFrameThis(JSContext *cx, JSStackFrame *fp)
|
||||
{
|
||||
if (!fp->thisp && fp->argv) {
|
||||
fp->thisp = js_ComputeThis(cx, JS_TRUE, fp->argv);
|
||||
if (!fp->thisp)
|
||||
return NULL;
|
||||
JSStackFrame *afp;
|
||||
|
||||
if (fp->flags & JSFRAME_COMPUTED_THIS)
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче