JSFunction *fun; JSStackFrame *fp; jsint slot;  fun = (JSFunction *)JS_GetInstancePrivate(cx, obj, &js_FunctionClass, NULL); if (!fun) return JS_TRUE; for (fp = cx->fp; fp; fp = fp->down) {  if (fp->fun && !fp->fun->native) { if (fp->fun == fun) { slot = JSVAL_TO_INT(id); JS_ASSERT((uintN)slot < fp->fun->nvars); if ((uintN)slot < fp->nvars) *vp = fp->vars[slot]; } return JS_TRUE; } }
js_GetLocalVariable(JSContext *cx, JSObject *obj, jsval id, jsval *vp){    JSFunction *fun;    JSStackFrame *fp;    jsint slot;    fun = (JSFunction *)JS_GetInstancePrivate(cx, obj, &js_FunctionClass, NULL);    if (!fun)        return JS_TRUE;    for (fp = cx->fp; fp; fp = fp->down) {        /* Find most recent non-native function frame. */        if (fp->fun && !fp->fun->native) {            if (fp->fun == fun) {                slot = JSVAL_TO_INT(id);                JS_ASSERT((uintN)slot < fp->fun->nvars);                if ((uintN)slot < fp->nvars)                    *vp = fp->vars[slot];            }            return JS_TRUE;        }    }    return JS_TRUE;}