diff options
Diffstat (limited to 'src/qml/parser')
-rw-r--r-- | src/qml/parser/qqmljsast.cpp | 8 | ||||
-rw-r--r-- | src/qml/parser/qqmljsast_p.h | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index f68381ce44..4f70bf0004 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -984,9 +984,9 @@ FunctionExpression *FunctionExpression::asFunctionDefinition() return this; } -QStringList FormalParameterList::formals() const +BoundNames FormalParameterList::formals() const { - QStringList formals; + BoundNames formals; int i = 0; for (const FormalParameterList *it = this; it; it = it->next) { if (it->element) { @@ -994,9 +994,9 @@ QStringList FormalParameterList::formals() const int duplicateIndex = formals.indexOf(name); if (duplicateIndex >= 0) { // change the name of the earlier argument to enforce the lookup semantics from the spec - formals[duplicateIndex] += QLatin1String("#") + QString::number(i); + formals[duplicateIndex].id += QLatin1String("#") + QString::number(i); } - formals += name; + formals += {name, it->element->typeAnnotation}; } ++i; } diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index cdee4843b0..da8d0bcd8d 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -850,6 +850,11 @@ struct BoundNames : public QVector<BoundName> return -1; return found - constBegin(); } + + bool contains(const QString &name) const + { + return indexOf(name) != -1; + } }; class QML_PARSER_EXPORT PatternElement : public Node @@ -2410,7 +2415,7 @@ public: return false; } - QStringList formals() const; + BoundNames formals() const; BoundNames boundNames() const; |