forked from qt-creator/qt-creator
qmljs: fix unreachable test for catch clause
Change-Id: Ica1ff034b88f06849026957c8beed2cda77badcc Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
@@ -502,13 +502,13 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool visit(Block *) override
|
||||
bool openBlock()
|
||||
{
|
||||
++_block;
|
||||
return true;
|
||||
}
|
||||
|
||||
void endVisit(Block *) override
|
||||
void closeBlock()
|
||||
{
|
||||
auto it = _declaredBlockVariables.begin();
|
||||
auto end = _declaredBlockVariables.end();
|
||||
@@ -521,6 +521,26 @@ protected:
|
||||
--_block;
|
||||
}
|
||||
|
||||
bool visit(Block *) override
|
||||
{
|
||||
return openBlock();
|
||||
}
|
||||
|
||||
void endVisit(Block *) override
|
||||
{
|
||||
closeBlock();
|
||||
}
|
||||
|
||||
bool visit(Catch *) override
|
||||
{
|
||||
return openBlock();
|
||||
}
|
||||
|
||||
void endVisit(Catch *) override
|
||||
{
|
||||
closeBlock();
|
||||
}
|
||||
|
||||
void throwRecursionDepthError() override
|
||||
{
|
||||
addMessage(ErrHitMaximumRecursion, SourceLocation());
|
||||
|
Reference in New Issue
Block a user