forked from qt-creator/qt-creator
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: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -118,6 +118,12 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool visit(AST::TemplateLiteral *el) override
|
||||
{
|
||||
Node::accept(el->expression, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(AST::UiObjectBinding *node) override
|
||||
{
|
||||
if (node->qualifiedId
|
||||
@@ -398,6 +404,12 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(AST::TemplateLiteral *el) override
|
||||
{
|
||||
Node::accept(el->expression, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(AST::FunctionDeclaration *node) override
|
||||
{
|
||||
return visit(static_cast<FunctionExpression *>(node));
|
||||
@@ -557,6 +569,12 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(AST::TemplateLiteral *el) override
|
||||
{
|
||||
Node::accept(el->expression, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(UiScriptBinding *node) override
|
||||
{
|
||||
return !checkBindingName(node->qualifiedId);
|
||||
|
||||
Reference in New Issue
Block a user