if (jp->pretty) { js_puts(jp, "\n"); } else {
if (!jp->pretty) {
js_DecompileFunction(JSPrinter *jp, JSFunction *fun){    JSContext *cx;    uintN i, nargs, indent;    void *mark;    JSAtom **params;    JSScope *scope, *oldscope;    JSScopeProperty *sprop;    JSBool ok;    /*     * If pretty, conform to ECMA-262 Edition 3, 15.3.4.2, by decompiling a     * FunctionDeclaration.  Otherwise, check the JSFUN_LAMBDA flag and force     * an expression by parenthesizing.     */    if (jp->pretty) {        js_puts(jp, "\n");        js_printf(jp, "\t");    } else {        if (!jp->grouped && (fun->flags & JSFUN_LAMBDA))            js_puts(jp, "(");    }    if (fun->flags & JSFUN_GETTER)        js_printf(jp, "%s ", js_getter_str);    else if (fun->flags & JSFUN_SETTER)        js_printf(jp, "%s ", js_setter_str);    js_printf(jp, "%s ", js_function_str);    if (fun->atom && !QuoteString(&jp->sprinter, ATOM_TO_STRING(fun->atom), 0))        return JS_FALSE;    js_puts(jp, "(");    if (fun->interpreted && fun->object) {        /*         * Print the parameters.         *         * This code is complicated by the need to handle duplicate parameter         * names, as required by ECMA (bah!).  A duplicate parameter is stored         * as another node with the same id (the parameter name) but different         * shortid (the argument index) along the property tree ancestor line         * starting at SCOPE_LAST_PROP(scope).  Only the last duplicate param         * is mapped by the scope's hash table.         */        cx = jp->sprinter.context;        nargs = fun->nargs;        mark = JS_ARENA_MARK(&cx->tempPool);        JS_ARENA_ALLOCATE_CAST(params, JSAtom **, &cx->tempPool,                               nargs * sizeof(JSAtom *));        if (!params) {            JS_ReportOutOfMemory(cx);            return JS_FALSE;        }        scope = OBJ_SCOPE(fun->object);        for (sprop = SCOPE_LAST_PROP(scope); sprop; sprop = sprop->parent) {            if (sprop->getter != js_GetArgument)                continue;            JS_ASSERT(sprop->flags & SPROP_HAS_SHORTID);            JS_ASSERT((uint16) sprop->shortid < nargs);            JS_ASSERT(JSID_IS_ATOM(sprop->id));            params[(uint16) sprop->shortid] = JSID_TO_ATOM(sprop->id);        }        for (i = 0; i < nargs; i++) {            if (i > 0)                js_puts(jp, ", ");            if (!QuoteString(&jp->sprinter, ATOM_TO_STRING(params[i]), 0))                return JS_FALSE;        }        JS_ARENA_RELEASE(&cx->tempPool, mark);#ifdef __GNUC__    } else {        scope = NULL;#endif    }    js_printf(jp, ") {\n");    indent = jp->indent;    jp->indent += 4;    if (fun->interpreted && fun->object) {        oldscope = jp->scope;        jp->scope = scope;        ok = js_DecompileScript(jp, fun->u.script);        jp->scope = oldscope;        if (!ok) {            jp->indent = indent;            return JS_FALSE;        }    } else {        js_printf(jp, native_code_str);    }    jp->indent -= 4;    js_printf(jp, "\t}");    if (jp->pretty) {        js_puts(jp, "\n");    } else {        if (!jp->grouped && (fun->flags & JSFUN_LAMBDA))            js_puts(jp, ")");    }    return JS_TRUE;}