Commit 918f5a0e authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Fix bug in context property extraction.

Skip forward declarations instead of giving up.

Change-Id: Id3a30296a7cefc4ef255d03727557dee6a37c362
Reviewed-on: http://codereview.qt-project.org/6321

Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
parent 42b56788
...@@ -659,10 +659,13 @@ static void buildContextProperties( ...@@ -659,10 +659,13 @@ static void buildContextProperties(
typeScope = scope; // incorrect but may be an ok fallback typeScope = scope; // incorrect but may be an ok fallback
ClassOrNamespace *binding = typeOf.context().lookupType(namedType->name(), typeScope); ClassOrNamespace *binding = typeOf.context().lookupType(namedType->name(), typeScope);
if (binding && !binding->symbols().isEmpty()) { if (binding && !binding->symbols().isEmpty()) {
Class *klass = binding->symbols().first()->asClass(); // find the best 'Class' symbol
if (klass) { for (int i = binding->symbols().size() - 1; i >= 0; --i) {
FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf); if (Class *klass = binding->symbols().at(i)->asClass()) {
typeName = fmo->className(); FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf);
typeName = fmo->className();
break;
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment