diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-07-14 16:31:19 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-07-15 18:51:39 +0000 |
commit | bf5f97e6c6900535a7131c6a26415459bfaca774 (patch) | |
tree | a8158d0398faaa1419bbe59c76b45f782566dc96 /src/qml/compiler/qqmltypecompiler_p.h | |
parent | f1736b9a94a8bce40a26efba766e935ae6865530 (diff) |
Fix alias resolution algorithm
The resolution of aliases needs to to be solved in iterations as an alias can
refer to another alias, which may not be created yet in the property cache by
the time we try to perform the resolution. Therefore the alias resolution code
works off a list of pending aliases after the initial pass of resolution. This
also requires the ability to detect circular references.
Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler_p.h')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler_p.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h index 93ae7d1fad..0b078fd642 100644 --- a/src/qml/compiler/qqmltypecompiler_p.h +++ b/src/qml/compiler/qqmltypecompiler_p.h @@ -266,6 +266,16 @@ protected: void findAndRegisterImplicitComponents(const QmlIR::Object *obj, QQmlPropertyCache *propertyCache); bool collectIdsAndAliases(int objectIndex); bool resolveAliases(); + void propertyDataForAlias(QmlIR::Alias *alias, int *type, quint32 *propertyFlags); + + enum AliasResolutionResult { + NoAliasResolved, + SomeAliasesResolved, + AllAliasesResolved + }; + + AliasResolutionResult resolveAliasesInObject(int objectIndex, QQmlCompileError *error); + void addAliasesToPropertyCache(int objectIndex); QQmlEnginePrivate *enginePrivate; QQmlJS::MemoryPool *pool; @@ -278,7 +288,7 @@ protected: int _componentIndex; QHash<int, int> _idToObjectIndex; - QList<int> _objectsWithAliases; + QVector<int> _objectsWithAliases; QHash<int, QV4::CompiledData::CompilationUnit::ResolvedTypeReference*> *resolvedTypes; QQmlPropertyCacheVector propertyCaches; |