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:
Fawzi Mohamed
2020-07-29 02:27:00 +02:00
parent d59f22d000
commit 1ea9d6ce87

View File

@@ -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());