Bug 872735, part 1 - Remove isEmptySemicolon from the ParseHandler protocol. It was only used for a warning about "if (foo);". r=Waldo.

This commit is contained in:
Jason Orendorff 2013-06-14 16:30:39 -05:00
parent f1ea85072a
commit ab3900fa43
3 changed files with 6 additions and 10 deletions

View File

@ -292,9 +292,6 @@ class FullParseHandler
}
return NULL;
}
bool isEmptySemicolon(ParseNode *pn) {
return pn->isKind(PNK_SEMI) && !pn->pn_kid;
}
inline ParseNode *makeAssignment(ParseNode *pn, ParseNode *rhs);

View File

@ -4582,18 +4582,18 @@ Parser<ParseHandler>::statement()
if (!cond)
return null();
if (tokenStream.peekToken() == TOK_SEMI &&
!report(ParseExtraWarning, false, null(), JSMSG_EMPTY_CONSEQUENT))
{
return null();
}
StmtInfoPC stmtInfo(context);
PushStatementPC(pc, &stmtInfo, STMT_IF);
Node thenBranch = statement();
if (!thenBranch)
return null();
if (handler.isEmptySemicolon(thenBranch) &&
!report(ParseExtraWarning, false, null(), JSMSG_EMPTY_CONSEQUENT))
{
return null();
}
Node elseBranch;
if (tokenStream.matchToken(TOK_ELSE, TSF_OPERAND)) {
stmtInfo.type = STMT_ELSE;

View File

@ -174,7 +174,6 @@ class SyntaxParseHandler
}
return NULL;
}
bool isEmptySemicolon(Node pn) { return false; }
Node makeAssignment(Node pn, Node rhs) { return NodeGeneric; }