diff --git a/js/src/jsdbgapi.c b/js/src/jsdbgapi.c index 55755ffec9bf..6f59f3de0767 100644 --- a/js/src/jsdbgapi.c +++ b/js/src/jsdbgapi.c @@ -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; diff --git a/js/src/jsinterp.c b/js/src/jsinterp.c index 5a313420d54b..a8fb8fa392a4 100644 --- a/js/src/jsinterp.c +++ b/js/src/jsinterp.c @@ -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) diff --git a/js/src/jsparse.c b/js/src/jsparse.c index 6cd4b3f674c3..5d178583ef0e 100644 --- a/js/src/jsparse.c +++ b/js/src/jsparse.c @@ -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,