js_ReportCompileError(cx, ts, "%.*s is a reserved identifier", ts->token.pos.end.index - ts->token.pos.begin.index, ts->token.ptr);
js_ReportCompileError(cx, ts, "%s is a reserved identifier", js_DeflateString(cx, ts->token.ptr, ts->token.pos.end.index - ts->token.pos.begin.index));
PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc){    JSTokenType tt;    JSParseNode *pn, *pn2, *pn3;#if JS_HAS_SHARP_VARS    JSParseNode *defsharp;    JSBool notsharp;    defsharp = NULL;    notsharp = JS_FALSE;  again:    /*     * Control flows here after #n= is scanned.  If the following primary is     * not valid after such a "sharp variable" definition, the token type case     * should set notsharp.     */#endif    ts->flags |= TSF_REGEXP;    tt = js_GetToken(cx, ts);    ts->flags &= ~TSF_REGEXP;    switch (tt) {#if JS_HAS_LEXICAL_CLOSURE      case TOK_FUNCTION:	pn = FunctionExpr(cx, ts, tc);	if (!pn)	    return NULL;	break;#endif#if JS_HAS_INITIALIZERS      case TOK_LB:      {	JSBool matched;	jsint atomIndex;	pn = NewParseNode(cx, &ts->token, PN_LIST);	if (!pn)	    return NULL;	pn->pn_type = TOK_RB;	pn->pn_extra = JS_FALSE;#if JS_HAS_SHARP_VARS	if (defsharp) {	    PN_INIT_LIST_1(pn, defsharp);	    defsharp = NULL;	} else#endif	    PN_INIT_LIST(pn);	ts->flags |= TSF_REGEXP;	matched = js_MatchToken(cx, ts, TOK_RB);	ts->flags &= ~TSF_REGEXP;	if (!matched) {	    for (atomIndex = 0; atomIndex < ATOM_INDEX_LIMIT; atomIndex++) {		ts->flags |= TSF_REGEXP;		tt = js_PeekToken(cx, ts);		ts->flags &= ~TSF_REGEXP;		if (tt == TOK_RB) {		    pn->pn_extra = JS_TRUE;		    break;		}		if (tt == TOK_COMMA)		    pn2 = NewParseNode(cx, &ts->token, PN_NULLARY);		else		    pn2 = AssignExpr(cx, ts, tc);		if (!pn2)		    return NULL;	    	PN_APPEND(pn, pn2);		if (!js_MatchToken(cx, ts, TOK_COMMA))		    break;	    }	    /* [balance: */	    MUST_MATCH_TOKEN(TOK_RB, "missing ] after element list");	}	pn->pn_pos.end = ts->token.pos.end;	return pn;      }      case TOK_LC:	pn = NewParseNode(cx, &ts->token, PN_LIST);	if (!pn)	    return NULL;	pn->pn_type = TOK_RC;#if JS_HAS_SHARP_VARS	if (defsharp) {	    PN_INIT_LIST_1(pn, defsharp);	    defsharp = NULL;	} else#endif	    PN_INIT_LIST(pn);	if (!js_MatchToken(cx, ts, TOK_RC)) {	    do {		tt = js_GetToken(cx, ts);		switch (tt) {		  case TOK_NUMBER:		    pn3 = NewParseNode(cx, &ts->token, PN_NULLARY);		    if (pn3)		    	pn3->pn_dval = ts->token.t_dval;		    break;		  case TOK_NAME:		  case TOK_STRING:		    pn3 = NewParseNode(cx, &ts->token, PN_NULLARY);		    if (pn3)			pn3->pn_atom = ts->token.t_atom;		    break;		  case TOK_RC:		    goto end_obj_init;		  default:		    js_ReportCompileError(cx, ts, "invalid property id");		    return NULL;		}		MUST_MATCH_TOKEN(TOK_COLON, "missing : after property id");		pn2 = NewBinary(cx, TOK_COLON, JSOP_INITPROP, pn3,				AssignExpr(cx, ts, tc));		if (!pn2)		    return NULL;	    	PN_APPEND(pn, pn2);	    } while (js_MatchToken(cx, ts, TOK_COMMA));	    /* {balance: */	    MUST_MATCH_TOKEN(TOK_RC, "missing } after property list");	}      end_obj_init:	pn->pn_pos.end = ts->token.pos.end;	return pn;#if JS_HAS_SHARP_VARS      case TOK_DEFSHARP:	if (defsharp)	    goto badsharp;	defsharp = NewParseNode(cx, &ts->token, PN_UNARY);	if (!defsharp)	    return NULL;	defsharp->pn_num = (jsint) ts->token.t_dval;	defsharp->pn_kid = NULL;	goto again;      case TOK_USESHARP:	/* Check for forward/dangling references at runtime, to allow eval. */	pn = NewParseNode(cx, &ts->token, PN_NULLARY);	if (!pn)	    return NULL;	pn->pn_num = (jsint) ts->token.t_dval;	notsharp = JS_TRUE;	break;#endif /* JS_HAS_SHARP_VARS */#endif /* JS_HAS_INITIALIZERS */      case TOK_LP:	pn = NewParseNode(cx, &ts->token, PN_UNARY);	if (!pn)	    return NULL;	pn2 = Expr(cx, ts, tc);	if (!pn2)	    return NULL;	/* (balance: */	MUST_MATCH_TOKEN(TOK_RP, "missing ) in parenthetical");	pn->pn_type = TOK_RP;	pn->pn_pos.end = ts->token.pos.end;	pn->pn_kid = pn2;	break;      case TOK_STRING:	notsharp = JS_TRUE;	/* FALL THROUGH */      case TOK_NAME:      case TOK_OBJECT:	pn = NewParseNode(cx, &ts->token, PN_NULLARY);	if (!pn)	    return NULL;	pn->pn_op = ts->token.t_op;	pn->pn_atom = ts->token.t_atom;	pn->pn_slot = -1;	if (tt == TOK_NAME) {	    if (!LookupArgOrVar(cx, pn->pn_atom, tc, &pn->pn_op, &pn->pn_slot))		return NULL;	    pn->pn_arity = PN_NAME;	    pn->pn_expr = NULL;	}	break;      case TOK_NUMBER:	pn = NewParseNode(cx, &ts->token, PN_NULLARY);	if (!pn)	    return NULL;	pn->pn_dval = ts->token.t_dval;	notsharp = JS_TRUE;	break;      case TOK_PRIMARY:	pn = NewParseNode(cx, &ts->token, PN_NULLARY);	if (!pn)	    return NULL;	pn->pn_op = ts->token.t_op;	notsharp = JS_TRUE;	break;#if !JS_HAS_EXPORT_IMPORT      case TOK_EXPORT:      case TOK_IMPORT:#endif      case TOK_RESERVED:	js_ReportCompileError(cx, ts, "%.*s is a reserved identifier",	    ts->token.pos.end.index - ts->token.pos.begin.index,	    ts->token.ptr);	return NULL;      case TOK_ERROR:	/* The scanner or one of its subroutines reported the error. */	return NULL;      default:	js_ReportCompileError(cx, ts, "syntax error");	return NULL;    }#if JS_HAS_SHARP_VARS    if (defsharp) {	if (notsharp) {  badsharp:	    js_ReportCompileError(cx, ts, "invalid sharp variable definition");	    return NULL;	}	defsharp->pn_kid = pn;	return defsharp;    }#endif    return pn;}