diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2021-06-02 10:07:25 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2021-06-03 10:30:53 +0200 |
commit | 57ecb25593fb7dd6601e1718773ce52e4247b500 (patch) | |
tree | a3356818df8364666df62f2c6167e2138d21afd6 /src | |
parent | 93b5744c2884213225b6e70baaf98e61e8f225a0 (diff) |
Set index to QQmlJSMetaProperty when traversing QQmlJS::AST
Along the way, add few Q_ASSERTs to make sure property index
is set when it should be set
Change-Id: Ifa2d3e08deda65368f47c7071385b0f24dd4cecd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index 606e34c35a..05bdae8ec6 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -173,6 +173,7 @@ void QQmlJSImportVisitor::resolveAliases() if (const QString internalName = type->internalName(); !internalName.isEmpty()) property.setTypeName(internalName); } + Q_ASSERT(property.index() >= 0); // this property is already in object object->addOwnProperty(property); } @@ -433,6 +434,7 @@ bool QQmlJSImportVisitor::visit(UiPublicMember *publicMember) prop.setAnnotations(parseAnnotations(publicMember->annotations)); if (publicMember->isDefaultMember) m_currentScope->setDefaultPropertyName(prop.propertyName()); + prop.setIndex(m_currentScope->ownProperties().size()); m_currentScope->insertPropertyIdentifier(prop); if (publicMember->isRequired) m_currentScope->setPropertyLocallyRequired(prop.propertyName(), true); |