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

List:       kde-commits
Subject:    Re: [kdev-qmljs] duchain: Support UiObjectInitializer without ClassDeclarations.
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2013-09-30 22:30:58
Message-ID: CACcA1Ro-S5dyQaaABw8XLPpXO9JfvZgkurufb2swUcVGhF8i0w () mail ! gmail ! com
[Download RAW message or body]

no unit test? :D


On Tue, Oct 1, 2013 at 12:11 AM, Milian Wolff <mail@milianw.de> wrote:

> 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;
>  }
>
>
>

[Attachment #3 (text/html)]

<div dir="ltr">no unit test? :D</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, \
Oct 1, 2013 at 12:11 AM, Milian Wolff <span dir="ltr">&lt;<a href="mailto:mail@milianw.de" \
target="_blank">mail@milianw.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Git \
commit 29a72f5c1234f1a47404e02d763da923be97fb58 by Milian Wolff.<br> Committed on 30/09/2013 at \
22:08.<br> Pushed by mwolff into branch &#39;master&#39;.<br>
<br>
Support UiObjectInitializer without ClassDeclarations.<br>
<br>
This is valid QML and thus must be supported. In the future we<br>
might want to create ClassDeclarations for UiObjectBinding as<br>
well though.<br>
<br>
BUG: 324690<br>
<br>
M   +4      -3      duchain/declarationbuilder.cpp<br>
<br>
<a href="http://commits.kde.org/kdev-qmljs/29a72f5c1234f1a47404e02d763da923be97fb58" \
target="_blank">http://commits.kde.org/kdev-qmljs/29a72f5c1234f1a47404e02d763da923be97fb58</a><br> <br>
diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cpp<br>
index 0d0bf93..44d85d7 100644<br>
--- a/duchain/declarationbuilder.cpp<br>
+++ b/duchain/declarationbuilder.cpp<br>
@@ -185,9 +185,10 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiObjectInitializer* node)<br>
  {<br>
        bool ret = DeclarationBuilderBase::visit(node);<br>
        DUChainWriteLocker lock;<br>
-      Q_ASSERT(currentContext());<br>
-      Q_ASSERT(currentDeclaration&lt;ClassDeclaration&gt;());<br>
-      currentDeclaration()-&gt;setInternalContext(currentContext());<br>
+      if (currentDeclaration&lt;ClassDeclaration&gt;()) {<br>
+            Q_ASSERT(currentContext());<br>
+            currentDeclaration()-&gt;setInternalContext(currentContext());<br>
+      }<br>
        return ret;<br>
  }<br>
<br>
<br>
</blockquote></div><br></div>



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

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