qmljs: correctly handle js string templates

In most cases we do want to visit the expressions in a function
template. Changing its accept0 would force those not wanting to visit
it to iterate on the templates (currently a linked list), so we add a
visit method explicitly visiting the expression in all the needed
places.

Fixes: QTCREATORBUG-21869
Change-Id: I47733544bfd32eec357810b97242608b8f7de572
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Fawzi Mohamed
2021-12-06 09:44:24 +01:00
parent 22ec44b5f3
commit a3b1dfd34a
19 changed files with 99 additions and 0 deletions

View File

@@ -809,6 +809,12 @@ bool Check::visit(UiObjectInitializer *)
return true;
}
bool Check::visit(AST::TemplateLiteral *ast)
{
Node::accept(ast->expression, this);
return true;
}
void Check::endVisit(UiObjectInitializer *uiObjectInitializer)
{
Q_UNUSED(uiObjectInitializer)