if (!js_GetArgsValue(cx, fp, vp)) return JS_FALSE;
if (TEST_BIT(slot, fp->overrides)) { if (!JS_GetProperty(cx, fp->callobj, js_arguments_str, vp)) return JS_FALSE; } else { JSObject *argsobj = js_GetArgsObject(cx, fp); if (!argsobj) return JS_FALSE; *vp = OBJECT_TO_JSVAL(argsobj); }
fun_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){    jsint slot;    JSFunction *fun;    JSStackFrame *fp;#if defined XP_PC && defined _MSC_VER &&_MSC_VER <= 800    /* MSVC1.5 coredumps */    jsval bogus = *vp;#endif    if (!JSVAL_IS_INT(id))        return JS_TRUE;    slot = JSVAL_TO_INT(id);    /* No valid function object should lack private data, but check anyway. */    fun = (JSFunction *) 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->special); fp = fp->down)        continue;    switch (slot) {      case CALL_ARGUMENTS:#if JS_HAS_ARGS_OBJECT        /* Warn if strict about f.arguments or equivalent unqualified uses. */        if (JS_HAS_STRICT_OPTION(cx) &&            !JS_ReportErrorFlagsAndNumber(cx,                                          JSREPORT_WARNING | JSREPORT_STRICT,                                          js_GetErrorMessage, NULL,                                          JSMSG_DEPRECATED_USAGE,                                          js_arguments_str)) {            return JS_FALSE;        }        if (fp) {            if (!js_GetArgsValue(cx, fp, vp))                return JS_FALSE;        } else {            *vp = JSVAL_NULL;        }        break;#else  /* !JS_HAS_ARGS_OBJECT */        *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);            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;}