diff --git a/js/ref/jsparse.c b/js/ref/jsparse.c index d0873c2d371c..fb635eb7afa5 100644 --- a/js/ref/jsparse.c +++ b/js/ref/jsparse.c @@ -1618,9 +1618,10 @@ LookupArgOrVar(JSContext *cx, JSAtom *atom, JSTreeContext *tc, JSOp *opp, jsint *slotp) { JSObject *obj, *pobj; + JSFunction *fun; JSScopeProperty *sprop; - obj = cx->fp->scopeChain; + obj = js_FindVariableScope(cx, &fun); if (OBJ_GET_CLASS(cx, obj) != &js_FunctionClass) return JS_TRUE; if (InWithStatement(tc))