QmlJS checks: Add 'unreachable code' warnings.

Change-Id: I59e490adce5c0cd7784894a0f9d4435cdcbc9b23
Reviewed-on: http://codereview.qt-project.org/4332
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-07 07:21:38 +02:00
parent fdeb7620f1
commit 6808607c3b
2 changed files with 234 additions and 26 deletions

View File

@@ -74,7 +74,8 @@ public:
WarnCaseWithoutFlowControlEnd = 1 << 11,
WarnNonCapitalizedNew = 1 << 12,
WarnCallsOfCapitalizedFunctions = 1 << 13,
ErrCheckTypeErrors = 1 << 14
WarnUnreachablecode = 1 << 14,
ErrCheckTypeErrors = 1 << 15
};
Q_DECLARE_FLAGS(Options, Option)
@@ -127,6 +128,7 @@ private:
void checkEndsWithControlFlow(AST::StatementList *statements, AST::SourceLocation errorLoc);
void checkProperty(QmlJS::AST::UiQualifiedId *);
void checkNewExpression(AST::ExpressionNode *node);
void checkBindingRhs(AST::Statement *statement);
void warning(const AST::SourceLocation &loc, const QString &message);
void error(const AST::SourceLocation &loc, const QString &message);