if (sprop) { OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop); sprop = NULL; } ok = js_DefineProperty(cx, fun->object, (jsid)argAtom, JSVAL_VOID, js_GetArgument, js_SetArgument, JSPROP_ENUMERATE | JSPROP_PERMANENT, (JSProperty **)&sprop);
FunctionDef(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,	    JSBool lambda){    JSParseNode *pn, *pn2;    JSAtom *funAtom, *argAtom;    JSObject *parent;    JSFunction *fun, *outerFun;    JSStmtInfo *topStmt;    JSBool ok, named;    JSObject *pobj;    JSScopeProperty *sprop;    jsval junk;    /* Make a TOK_FUNCTION node. */    pn = NewParseNode(cx, &ts->token, PN_FUNC);    if (!pn)    	return NULL;    /* Scan the optional function name into funAtom. */    if (js_MatchToken(cx, ts, TOK_NAME))	funAtom = ts->token.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;    /* Clear tc->topStmt for semantic checking (restore at label out:). */    topStmt = tc->topStmt;    tc->topStmt = NULL;#if JS_HAS_LEXICAL_CLOSURE    if (!funAtom || cx->fp->scopeChain != parent || InWithStatement(tc)) {	/* Don't name the function if enclosed by a with statement or equiv. */	fun = js_NewFunction(cx, NULL, NULL, 0, 0, cx->fp->scopeChain,			     funAtom);	named = JS_FALSE;    } else#endif    {	/* Override any previously defined property using js_DefineFunction. */	fun = js_DefineFunction(cx, parent, funAtom, NULL, 0, JSPROP_ENUMERATE);	named = (fun != NULL);    }    if (!fun) {	ok = JS_FALSE;	goto out;    }    /* Now parse formal argument list and compute fun->nargs. */    MUST_MATCH_TOKEN_THROW(TOK_LP, "missing ( before formal parameters",			   ok = JS_FALSE; goto out);    /* balance) */    if (!js_MatchToken(cx, ts, TOK_RP)) {	do {	    MUST_MATCH_TOKEN_THROW(TOK_NAME, "missing formal parameter",				   ok = JS_FALSE; goto out);	    argAtom = ts->token.t_atom;	    pobj = NULL;	    ok = js_LookupProperty(cx, fun->object, (jsid)argAtom, &pobj,				   (JSProperty **)&sprop);	    if (!ok)		goto out;	    if (sprop && pobj == fun->object) {#ifdef CHECK_ARGUMENT_HIDING		if (sprop->getter == js_GetArgument) {		    OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);		    js_ReportCompileError(cx, ts,					  "duplicate formal argument %s",					  ATOM_BYTES(argAtom));		    ok = JS_FALSE;		    goto out;		}#endif		sprop->getter = js_GetArgument;		sprop->setter = js_SetArgument;		sprop->attrs |= JSPROP_ENUMERATE | JSPROP_PERMANENT;	    } else {		if (sprop) {		    OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);		    sprop = NULL;		}		ok = js_DefineProperty(cx, fun->object,				       (jsid)argAtom, JSVAL_VOID,				       js_GetArgument, js_SetArgument,				       JSPROP_ENUMERATE | JSPROP_PERMANENT,				       (JSProperty **)&sprop);	    }	    if (!ok)		goto out;	    PR_ASSERT(sprop);	    sprop->id = INT_TO_JSVAL(fun->nargs++);	    OBJ_DROP_PROPERTY(cx, fun->object, (JSProperty *)sprop);	} while (js_MatchToken(cx, ts, TOK_COMMA));	/* (balance: */	MUST_MATCH_TOKEN_THROW(TOK_RP, "missing ) after formal parameters",			       ok = JS_FALSE; goto out);    }    MUST_MATCH_TOKEN_THROW(TOK_LC, "missing { before function body",			   ok = JS_FALSE; goto out);    pn->pn_pos.begin = ts->token.pos.begin;    pn2 = FunctionBody(cx, ts, fun, tc);    if (!pn2) {    	ok = JS_FALSE;    	goto out;    }    MUST_MATCH_TOKEN_THROW(TOK_RC, "missing } after function body",			   ok = JS_FALSE; goto out);    pn->pn_pos.end = ts->token.pos.end;    pn->pn_fun = fun;    pn->pn_body = pn2;    pn->pn_tryCount = tc->tryCount;#if JS_HAS_LEXICAL_CLOSURE    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;    ok = JS_TRUE;out:    tc->topStmt = topStmt;    if (!ok) {	if (named)	    (void) OBJ_DELETE_PROPERTY(cx, parent, (jsid)funAtom, &junk);	return NULL;    }    return pn;}