for (fp = cx->fp; fp && (fp->fun != fun || fp->flags); fp = fp->down)
for (fp = cx->fp; fp && (fp->fun != fun || fp->special); fp = fp->down)
fun_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){    JSFunction *fun;    JSStackFrame *fp;    jsint slot;#if defined XP_PC && defined _MSC_VER &&_MSC_VER <= 800    /* MSVC1.5 coredumps */    jsval bogus = *vp;#endif    if (!JSVAL_IS_INT(id)) {	/* Map qualified access of the form f.arity to f.__arity__. */	if (id == ATOM_KEY(cx->runtime->atomState.arityAtom)) {	    id = INT_TO_JSVAL(FUN_ARITY);	} else if (id == ATOM_KEY(cx->runtime->atomState.lengthAtom)) {	    id = INT_TO_JSVAL(ARGS_LENGTH);	} else if (id == ATOM_KEY(cx->runtime->atomState.nameAtom)) {	    id = INT_TO_JSVAL(FUN_NAME);	} else {	    return JS_TRUE;	}    }    /* No valid function object should lack private data, but check anyway. */    fun = JS_GetPrivate(cx, obj);    if (!fun)	return JS_TRUE;    /* Find fun's top-most activation record. */    for (fp = cx->fp; fp && (fp->fun != fun || fp->flags); fp = fp->down)	continue;    slot = (jsint)JSVAL_TO_INT(id);    switch (slot) {#if JS_HAS_ARGS_OBJECT      case CALL_ARGUMENTS:	if (fp && fp->fun) {	    JSObject *argsobj = js_GetArgsObject(cx, fp);	    if (!argsobj)		return JS_FALSE;	    *vp = OBJECT_TO_JSVAL(argsobj);	} else {	    *vp = JSVAL_NULL;	}	break;#else  /* !JS_HAS_ARGS_OBJECT */      case CALL_ARGUMENTS:	*vp = OBJECT_TO_JSVAL(fp ? obj : NULL);	break;#endif /* !JS_HAS_ARGS_OBJECT */      case ARGS_LENGTH:	if (!JSVERSION_IS_ECMA(cx->version))	    *vp = INT_TO_JSVAL((jsint)(fp && fp->fun ? fp->argc : fun->nargs));	else      case FUN_ARITY:	    *vp = INT_TO_JSVAL((jsint)fun->nargs);	break;      case FUN_NAME:	*vp = fun->atom	      ? ATOM_KEY(fun->atom)	      : STRING_TO_JSVAL(cx->runtime->emptyString);	break;      case FUN_CALL:	if (fp && fp->fun) {	    JSObject *callobj = js_GetCallObject(cx, fp, NULL, NULL);	    if (!callobj)		return JS_FALSE;	    *vp = OBJECT_TO_JSVAL(callobj);	} else {	    *vp = JSVAL_NULL;	}	break;      default:	/* XXX fun[0] and fun.arguments[0] are equivalent. */	if (fp && fp->fun && (uintN)slot < fp->argc)#if defined XP_PC && defined _MSC_VER &&_MSC_VER <= 800	  /* MSVC1.5 coredumps */	  if (bogus == *vp)#endif	    *vp = fp->argv[slot];	break;    }    return JS_TRUE;}