mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
f1ea85072a
commit
ab3900fa43
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -174,7 +174,6 @@ class SyntaxParseHandler
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
bool isEmptySemicolon(Node pn) { return false; }
|
||||
|
||||
Node makeAssignment(Node pn, Node rhs) { return NodeGeneric; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user