"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libs/qmljs/qmljscheck.cpp" between
qt-creator-opensource-src-4.15.0.tar.xz and qt-creator-opensource-src-4.15.1.tar.xz

About: Qt Creator is a cross-platform, complete IDE (integrated development environment) tailored to the needs of Qt developers.

qmljscheck.cpp  (qt-creator-opensource-src-4.15.0.tar.xz):qmljscheck.cpp  (qt-creator-opensource-src-4.15.1.tar.xz)
skipping to change at line 1368 skipping to change at line 1368
&& !cast<UiPublicMember *>(p) && !cast<UiPublicMember *>(p)
&& !cast<TryStatement *>(p) && !cast<TryStatement *>(p)
&& !cast<Catch *>(p) && !cast<Catch *>(p)
&& !cast<Finally *>(p) && !cast<Finally *>(p)
&& !cast<ForStatement *>(p) && !cast<ForStatement *>(p)
&& !cast<ForEachStatement *>(p) && !cast<ForEachStatement *>(p)
&& !cast<DoWhileStatement *>(p) && !cast<DoWhileStatement *>(p)
&& !cast<WhileStatement *>(p) && !cast<WhileStatement *>(p)
&& !cast<IfStatement *>(p) && !cast<IfStatement *>(p)
&& !cast<SwitchStatement *>(p) && !cast<SwitchStatement *>(p)
&& !cast<WithStatement *>(p)) { && !isCaseOrDefault(p)
&& !cast<WithStatement *>(p)
&& hasVarStatement(ast)) {
addMessage(WarnBlock, ast->lbraceToken); addMessage(WarnBlock, ast->lbraceToken);
} }
if (!ast->statements if (!ast->statements
&& cast<UiPublicMember *>(p) && cast<UiPublicMember *>(p)
&& ast->lbraceToken.startLine == ast->rbraceToken.startLine) { && ast->lbraceToken.startLine == ast->rbraceToken.startLine) {
addMessage(WarnUnintentinalEmptyBlock, locationFromRange(ast->firstS ourceLocation(), ast->lastSourceLocation())); addMessage(WarnUnintentinalEmptyBlock, locationFromRange(ast->firstS ourceLocation(), ast->lastSourceLocation()));
} }
} }
return true; return true;
} }
skipping to change at line 1658 skipping to change at line 1660
return false; return false;
} }
return _doc->language() == Dialect::QmlQtQuick2 || _doc->language() == Diale ct::QmlQtQuick2Ui; return _doc->language() == Dialect::QmlQtQuick2 || _doc->language() == Diale ct::QmlQtQuick2Ui;
} }
bool Check::isQtQuick2Ui() const bool Check::isQtQuick2Ui() const
{ {
return _doc->language() == Dialect::QmlQtQuick2Ui; return _doc->language() == Dialect::QmlQtQuick2Ui;
} }
bool Check::isCaseOrDefault(Node *n)
{
if (!cast<StatementList *>(n))
return false;
if (Node *p = parent(1))
return p->kind == Node::Kind_CaseClause || p->kind == Node::Kind_Default
Clause;
return false;
}
bool Check::hasVarStatement(AST::Block *b) const
{
QTC_ASSERT(b, return false);
StatementList *s = b->statements;
while (s) {
if (auto var = cast<VariableStatement *>(s->statement)) {
VariableDeclarationList *declList = var->declarations;
while (declList) {
if (declList->declaration && declList->declaration->scope == Var
iableScope::Var)
return true;
declList = declList->next;
}
}
s = s->next;
}
return false;
}
bool Check::visit(NewExpression *ast) bool Check::visit(NewExpression *ast)
{ {
checkNewExpression(ast->expression); checkNewExpression(ast->expression);
return true; return true;
} }
bool Check::visit(NewMemberExpression *ast) bool Check::visit(NewMemberExpression *ast)
{ {
checkNewExpression(ast->base); checkNewExpression(ast->base);
 End of changes. 2 change blocks. 
1 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)