else if (lambda) pn->pn_op = JSOP_OBJECT;
else if (lambda || !fun->atom) pn->pn_op = fun->atom ? JSOP_NAMEDFUNOBJ : JSOP_ANONFUNOBJ;
FunctionDef(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,            JSBool lambda){    JSParseNode *pn, *pn2;    JSOp op;    JSAtom *funAtom, *argAtom;    JSFunction *fun, *outerFun;    JSObject *parent;    JSObject *pobj;    JSScopeProperty *sprop;    JSTreeContext funtc;    jsid oldArgId;    /* Make a TOK_FUNCTION node. */    pn = NewParseNode(cx, &CURRENT_TOKEN(ts), PN_FUNC);    if (!pn)	return NULL;    op = CURRENT_TOKEN(ts).t_op;    /* Scan the optional function name into funAtom. */    if (js_MatchToken(cx, ts, TOK_NAME))	funAtom = CURRENT_TOKEN(ts).t_atom;    else	funAtom = NULL;    /* Find the nearest variable-declaring scope and use it as our parent. */    parent = js_FindVariableScope(cx, &outerFun);    if (!parent)	return NULL;    fun = js_NewFunction(cx, NULL, NULL, 0, 0, parent, funAtom);    if (!fun)        return NULL;#if JS_HAS_GETTER_SETTER    if (op != JSOP_NOP)        fun->flags |= (op == JSOP_GETTER) ? JSPROP_GETTER : JSPROP_SETTER;#endif    /* Now parse formal argument list and compute fun->nargs. */    MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_BEFORE_FORMAL);    if (!js_MatchToken(cx, ts, TOK_RP)) {	do {	    MUST_MATCH_TOKEN(TOK_NAME, JSMSG_MISSING_FORMAL);	    argAtom = CURRENT_TOKEN(ts).t_atom;	    pobj = NULL;	    if (!js_LookupProperty(cx, fun->object, (jsid)argAtom, &pobj,				   (JSProperty **)&sprop)) {		return NULL;            }	    if (sprop && pobj == fun->object) {		if (SPROP_GETTER(sprop, pobj) == js_GetArgument) {                    if (JS_HAS_STRICT_OPTION(cx)) {                        OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);                        js_ReportCompileErrorNumber(cx, ts, JSREPORT_ERROR,                                                    JSMSG_DUPLICATE_FORMAL,                                                    ATOM_BYTES(argAtom));                        return NULL;                    }		    /*		     * A duplicate parameter name. We create a dummy symbol		     * entry with property id of the parameter number and set		     * the id to the name of the parameter.		     * The decompiler will know to treat this case specially.		     */		    oldArgId = (jsid) sprop->id;		    OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);		    sprop = NULL;		    if (!js_DefineProperty(cx, fun->object,					   oldArgId, JSVAL_VOID,					   js_GetArgument, js_SetArgument,					   JSPROP_ENUMERATE | JSPROP_PERMANENT,					   (JSProperty **)&sprop)) {			return NULL;                    }		    sprop->id = (jsid) argAtom;		}	    }	    if (sprop) {		OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);		sprop = NULL;	    }	    if (!js_DefineProperty(cx, fun->object,				   (jsid)argAtom, JSVAL_VOID,				   js_GetArgument, js_SetArgument,				   JSPROP_ENUMERATE | JSPROP_PERMANENT,				   (JSProperty **)&sprop)) {		return NULL;            }	    JS_ASSERT(sprop);	    sprop->id = INT_TO_JSVAL(fun->nargs++);	    OBJ_DROP_PROPERTY(cx, fun->object, (JSProperty *)sprop);	} while (js_MatchToken(cx, ts, TOK_COMMA));	MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_AFTER_FORMAL);    }    MUST_MATCH_TOKEN(TOK_LC, JSMSG_CURLY_BEFORE_BODY);    pn->pn_pos.begin = CURRENT_TOKEN(ts).pos.begin;    TREE_CONTEXT_INIT(&funtc);    pn2 = FunctionBody(cx, ts, fun, &funtc);    if (!pn2)	return NULL;    MUST_MATCH_TOKEN(TOK_RC, JSMSG_CURLY_AFTER_BODY);    pn->pn_pos.end = CURRENT_TOKEN(ts).pos.end;#if JS_HAS_LEXICAL_CLOSURE    /*     * Generate a closure if in a nested function, or if in 'with (o) eval(s)'     * where s contains a function definition, or if in a with statement being     * compiled from the same source that contains this function.  Otherwise,     * if in a lambda expression, generate a function object reference.  Else,     * generate an annotated NOP for a top-level function.     */    if (outerFun || cx->fp->scopeChain != parent || InWithStatement(tc))        pn->pn_op = JSOP_CLOSURE;    else if (lambda)        pn->pn_op = JSOP_OBJECT;    else#endif        pn->pn_op = JSOP_NOP;    pn->pn_fun = fun;    pn->pn_body = pn2;    pn->pn_tryCount = funtc.tryCount;    TREE_CONTEXT_FREE(&funtc);    return pn;}