[Bug 439624] renaming decltype to declType as the former is a keyword in the next C++ standard.

This commit is contained in:
Igor Bukanov 2008-06-18 23:35:53 +02:00
Родитель 68ce1d3fe8
Коммит 568d8bf46c
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -1525,7 +1525,7 @@ js_DefineCompileTimeConstant(JSContext *cx, JSCodeGenerator *cg, JSAtom *atom,
#define VAR_DECL 2 #define VAR_DECL 2
JSStmtInfo * JSStmtInfo *
js_LexicalLookup(JSTreeContext *tc, JSAtom *atom, jsint *slotp, uintN decltype) js_LexicalLookup(JSTreeContext *tc, JSAtom *atom, jsint *slotp, uintN declType)
{ {
JSStmtInfo *stmt; JSStmtInfo *stmt;
JSObject *obj; JSObject *obj;
@ -1536,7 +1536,7 @@ js_LexicalLookup(JSTreeContext *tc, JSAtom *atom, jsint *slotp, uintN decltype)
for (stmt = tc->topScopeStmt; stmt; stmt = stmt->downScope) { for (stmt = tc->topScopeStmt; stmt; stmt = stmt->downScope) {
if (stmt->type == STMT_WITH) { if (stmt->type == STMT_WITH) {
/* Ignore with statements enclosing a single let declaration. */ /* Ignore with statements enclosing a single let declaration. */
if (decltype == LET_DECL) if (declType == LET_DECL)
continue; continue;
break; break;
} }
@ -1813,7 +1813,7 @@ EmitSlotIndexOp(JSContext *cx, JSOp op, uintN slot, uintN index,
*/ */
static JSBool static JSBool
BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn, BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
uintN decltype) uintN declType)
{ {
JSTreeContext *tc; JSTreeContext *tc;
JSAtom *atom; JSAtom *atom;
@ -1842,8 +1842,8 @@ BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
*/ */
tc = &cg->treeContext; tc = &cg->treeContext;
atom = pn->pn_atom; atom = pn->pn_atom;
if (decltype != VAR_DECL && if (declType != VAR_DECL &&
(stmt = js_LexicalLookup(tc, atom, &slot, decltype))) { (stmt = js_LexicalLookup(tc, atom, &slot, declType))) {
if (stmt->type == STMT_WITH) if (stmt->type == STMT_WITH)
return JS_TRUE; return JS_TRUE;
@ -3243,11 +3243,11 @@ static JSBool
EmitDestructuringDecl(JSContext *cx, JSCodeGenerator *cg, JSOp prologOp, EmitDestructuringDecl(JSContext *cx, JSCodeGenerator *cg, JSOp prologOp,
JSParseNode *pn) JSParseNode *pn)
{ {
JSOp decltype; JSOp declType;
JS_ASSERT(pn->pn_type == TOK_NAME); JS_ASSERT(pn->pn_type == TOK_NAME);
decltype = (JSOp) ((prologOp == JSOP_NOP) ? LET_DECL : VAR_DECL); declType = (JSOp) ((prologOp == JSOP_NOP) ? LET_DECL : VAR_DECL);
if (!BindNameToSlot(cx, cg, pn, decltype)) if (!BindNameToSlot(cx, cg, pn, declType))
return JS_FALSE; return JS_FALSE;
JS_ASSERT(pn->pn_op != JSOP_ARGUMENTS); JS_ASSERT(pn->pn_op != JSOP_ARGUMENTS);

Просмотреть файл

@ -505,7 +505,7 @@ js_DefineCompileTimeConstant(JSContext *cx, JSCodeGenerator *cg, JSAtom *atom,
*/ */
extern JSStmtInfo * extern JSStmtInfo *
js_LexicalLookup(JSTreeContext *tc, JSAtom *atom, jsint *slotp, js_LexicalLookup(JSTreeContext *tc, JSAtom *atom, jsint *slotp,
uintN decltype); uintN declType);
/* /*
* Emit code into cg for the tree rooted at pn. * Emit code into cg for the tree rooted at pn.