From 87f49ab3f082ee7af71c98945c31983278a75b91 Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Tue, 6 Dec 2011 14:54:53 +0100
Subject: [PATCH] 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>
---
 src/libs/qmljs/qmljsscopechain.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/qmljs/qmljsscopechain.cpp b/src/libs/qmljs/qmljsscopechain.cpp
index 946304293f8..a1d842e19ff 100644
--- a/src/libs/qmljs/qmljsscopechain.cpp
+++ b/src/libs/qmljs/qmljsscopechain.cpp
@@ -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);
-- 
GitLab