js_ReportCompileErrorNumber(cx, ts,JSREPORT_ERROR,
js_ReportCompileErrorNumber(cx, ts, JSREPORT_WARNING,
FunctionDef(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,	    JSBool lambda){    JSParseNode *pn, *pn2;    JSAtom *funAtom, *argAtom;    JSObject *parent;    JSFunction *fun, *outerFun;    JSBool ok, named;    JSObject *pobj;    JSScopeProperty *sprop;    JSTreeContext funtc;    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;#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, JSMSG_PAREN_BEFORE_FORMAL,			   ok = JS_FALSE; goto out);    /* balance) */    if (!js_MatchToken(cx, ts, TOK_RP)) {	do {	    MUST_MATCH_TOKEN_THROW(TOK_NAME, JSMSG_MISSING_FORMAL,				   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) {                if (sprop->getter == js_GetArgument) {#ifdef CHECK_ARGUMENT_HIDING                    OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);                    js_ReportCompileErrorNumber(cx, ts,JSREPORT_ERROR,                                          JSMSG_DUPLICATE_FORMAL,                                          ATOM_BYTES(argAtom));                    ok = JS_FALSE;                    goto out;#else                    /* 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.                     */                    jsid oldArgId = (jsid) sprop->id;                    OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);                    sprop = NULL;                    ok = js_DefineProperty(cx, fun->object,                                           oldArgId, JSVAL_VOID,                                           js_GetArgument, js_SetArgument,                                           JSPROP_ENUMERATE | JSPROP_PERMANENT,                                           (JSProperty **)&sprop);                    if (!ok)                        goto out;                    sprop->id = (jsid) argAtom;#endif                }            }	    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, JSMSG_PAREN_AFTER_FORMAL,			       ok = JS_FALSE; goto out);    }    MUST_MATCH_TOKEN_THROW(TOK_LC, JSMSG_CURLY_BEFORE_BODY,			   ok = JS_FALSE; goto out);    pn->pn_pos.begin = ts->token.pos.begin;    INIT_TREE_CONTEXT(&funtc);    pn2 = FunctionBody(cx, ts, fun, &funtc);    if (!pn2) {    	ok = JS_FALSE;    	goto out;    }    MUST_MATCH_TOKEN_THROW(TOK_RC, JSMSG_CURLY_AFTER_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 = funtc.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:    if (!ok) {	if (named)	    (void) OBJ_DELETE_PROPERTY(cx, parent, (jsid)funAtom, &junk);	return NULL;    }    return pn;}