[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdev-qmljs] duchain: Support UiObjectInitializer without ClassDeclarations.
From:       Milian Wolff <mail () milianw ! de>
Date:       2013-09-30 22:11:06
Message-ID: E1VQlgI-0000Wy-JF () scm ! kde ! org
[Download RAW message or body]

Git commit 29a72f5c1234f1a47404e02d763da923be97fb58 by Milian Wolff.
Committed on 30/09/2013 at 22:08.
Pushed by mwolff into branch 'master'.

Support UiObjectInitializer without ClassDeclarations.

This is valid QML and thus must be supported. In the future we
might want to create ClassDeclarations for UiObjectBinding as
well though.

BUG: 324690

M  +4    -3    duchain/declarationbuilder.cpp

http://commits.kde.org/kdev-qmljs/29a72f5c1234f1a47404e02d763da923be97fb58

diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cpp
index 0d0bf93..44d85d7 100644
--- a/duchain/declarationbuilder.cpp
+++ b/duchain/declarationbuilder.cpp
@@ -185,9 +185,10 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiObjectInitializer* node)
 {
     bool ret = DeclarationBuilderBase::visit(node);
     DUChainWriteLocker lock;
-    Q_ASSERT(currentContext());
-    Q_ASSERT(currentDeclaration<ClassDeclaration>());
-    currentDeclaration()->setInternalContext(currentContext());
+    if (currentDeclaration<ClassDeclaration>()) {
+        Q_ASSERT(currentContext());
+        currentDeclaration()->setInternalContext(currentContext());
+    }
     return ret;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic