forked from qt-creator/qt-creator
QmlJS checks: Warn about inappropriate use of constructor functions.
Change-Id: Iaedaaa88915f2010bfdd0d2b5ca95f01f8663ed7 Reviewed-on: http://codereview.qt.nokia.com/4254 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
@@ -72,7 +72,9 @@ public:
|
||||
WarnDuplicateDeclaration = 1 << 9,
|
||||
WarnDeclarationsNotStartOfFunction = 1 << 10,
|
||||
WarnCaseWithoutFlowControlEnd = 1 << 11,
|
||||
ErrCheckTypeErrors = 1 << 12
|
||||
WarnNonCapitalizedNew = 1 << 12,
|
||||
WarnCallsOfCapitalizedFunctions = 1 << 13,
|
||||
ErrCheckTypeErrors = 1 << 14
|
||||
};
|
||||
Q_DECLARE_FLAGS(Options, Option)
|
||||
|
||||
@@ -111,6 +113,9 @@ protected:
|
||||
virtual bool visit(AST::DoWhileStatement *ast);
|
||||
virtual bool visit(AST::CaseClause *ast);
|
||||
virtual bool visit(AST::DefaultClause *ast);
|
||||
virtual bool visit(AST::NewExpression *ast);
|
||||
virtual bool visit(AST::NewMemberExpression *ast);
|
||||
virtual bool visit(AST::CallExpression *ast);
|
||||
|
||||
virtual void endVisit(QmlJS::AST::UiObjectInitializer *);
|
||||
|
||||
@@ -121,6 +126,7 @@ private:
|
||||
void checkAssignInCondition(AST::ExpressionNode *condition);
|
||||
void checkEndsWithControlFlow(AST::StatementList *statements, AST::SourceLocation errorLoc);
|
||||
void checkProperty(QmlJS::AST::UiQualifiedId *);
|
||||
void checkNewExpression(AST::ExpressionNode *node);
|
||||
|
||||
void warning(const AST::SourceLocation &loc, const QString &message);
|
||||
void error(const AST::SourceLocation &loc, const QString &message);
|
||||
|
||||
Reference in New Issue
Block a user