QmlJS: Fix scoping for non-js files without scope objects.

For instance the Connections and ListModel elements have their scope
objects cleared but should still see the instantiating component chain.

Change-Id: I6fe48d77e4a99bbae2b7faa3ed38669832ccaa6a
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-12-06 14:54:53 +01:00
parent e1d1c9e6d6
commit 87f49ab3f0

View File

@@ -259,7 +259,7 @@ void ScopeChain::update() const
m_all += m_cppContextProperties;
// the root scope in js files doesn't see instantiating components
if (m_jsScopes.count() != 1 || !m_qmlScopeObjects.isEmpty()) {
if (m_document->language() != Document::JavaScriptLanguage || m_jsScopes.count() != 1) {
if (m_qmlComponentScope) {
foreach (const QmlComponentChain *parent, m_qmlComponentScope->instantiatingComponents())
collectScopes(parent, &m_all);