Fix 356250, r=mrbkap.

This commit is contained in:
brendan%mozilla.org 2006-10-14 04:39:26 +00:00
parent 4f974399c6
commit fb2f436548
3 changed files with 9 additions and 3 deletions

View File

@ -906,7 +906,7 @@ JS_EvaluateUCInStackFrame(JSContext *cx, JSStackFrame *fp,
JSScript *script;
JSBool ok;
scobj = js_GetScopeChain(cx, fp);
scobj = JS_GetFrameScopeChain(cx, fp);
if (!scobj)
return JS_FALSE;

View File

@ -488,7 +488,8 @@ js_GetScopeChain(JSContext *cx, JSStackFrame *fp)
* if this frame is a call frame.
*/
if (fp->fun && !fp->callobj) {
JS_ASSERT(OBJ_GET_CLASS(cx, fp->scopeChain) != &js_BlockClass);
JS_ASSERT(OBJ_GET_CLASS(cx, fp->scopeChain) != &js_BlockClass ||
JS_GetPrivate(cx, fp->scopeChain) != fp);
if (!js_GetCallObject(cx, fp, fp->scopeChain))
return NULL;
}
@ -1562,10 +1563,11 @@ js_Execute(JSContext *cx, JSObject *chain, JSScript *script,
hook = cx->runtime->executeHook;
hookData = mark = NULL;
oldfp = cx->fp;
frame.callobj = frame.argsobj = NULL;
frame.script = script;
if (down) {
/* Propagate arg/var state for eval and the debugger API. */
frame.callobj = down->callobj;
frame.argsobj = down->argsobj;
frame.varobj = down->varobj;
frame.fun = down->fun;
frame.thisp = down->thisp;
@ -1576,6 +1578,7 @@ js_Execute(JSContext *cx, JSObject *chain, JSScript *script,
frame.annotation = down->annotation;
frame.sharpArray = down->sharpArray;
} else {
frame.callobj = frame.argsobj = NULL;
obj = chain;
if (cx->options & JSOPTION_VAROBJFIX) {
while ((tmp = OBJ_GET_PARENT(cx, obj)) != NULL)

View File

@ -4327,6 +4327,9 @@ MemberExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,
RecycleTree(group, tc);
pn2->pn_type = TOK_FILTER;
pn2->pn_op = JSOP_FILTER;
/* A filtering predicate is like a with statement. */
tc->flags |= TCF_FUN_HEAVYWEIGHT;
} else {
js_ReportCompileErrorNumber(cx, ts,
JSREPORT_TS | JSREPORT_ERROR,