diff options
author | Marco Benelli <marco.benelli@qt.io> | 2018-10-16 15:32:58 +0200 |
---|---|---|
committer | Marco Benelli <marco.benelli@qt.io> | 2018-11-22 11:21:32 +0000 |
commit | 4646acad0db369302d08a1b83e1971be31c1df4f (patch) | |
tree | cc6b02cc0942309f9887e3a8e0f19a34e60123d5 /src/libs/qmljs/qmljsbind.cpp | |
parent | fe8a3727735f1e6cf9414999ff5103520b1a56f9 (diff) | |
download | qt-creator-4646acad0db369302d08a1b83e1971be31c1df4f.tar.gz |
qmljs: update parser
Update the qtcreator qmljs parser to the
one of Qt 5.12. It supports EcmaScript 7.
Task-number: QTCREATORBUG-20341
Change-Id: I0d1cff71402ba17e22cde6b46c65614e162280de
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/libs/qmljs/qmljsbind.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsbind.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp index 92516dee2e..6b904da040 100644 --- a/src/libs/qmljs/qmljsbind.cpp +++ b/src/libs/qmljs/qmljsbind.cpp @@ -306,14 +306,14 @@ bool Bind::visit(UiArrayBinding *) return true; } -bool Bind::visit(VariableDeclaration *ast) +bool Bind::visit(PatternElement *ast) { - if (ast->name.isEmpty()) + if (ast->bindingIdentifier.isEmpty() || !ast->isVariableDeclaration()) return false; ASTVariableReference *ref = new ASTVariableReference(ast, _doc, &_valueOwner); if (_currentObjectValue) - _currentObjectValue->setMember(ast->name.toString(), ref); + _currentObjectValue->setMember(ast->bindingIdentifier, ref); return true; } @@ -337,8 +337,8 @@ bool Bind::visit(FunctionExpression *ast) // 1. Function formal arguments for (FormalParameterList *it = ast->formals; it; it = it->next) { - if (!it->name.isEmpty()) - functionScope->setMember(it->name.toString(), _valueOwner.unknownValue()); + if (!it->element->bindingIdentifier.isEmpty()) + functionScope->setMember(it->element->bindingIdentifier, _valueOwner.unknownValue()); } // 2. Functions defined inside the function body |