--001a11c373e418ed3704e7a165f7 Content-Type: text/plain; charset=UTF-8 no unit test? :D On Tue, Oct 1, 2013 at 12:11 AM, Milian Wolff 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()); > - currentDeclaration()->setInternalContext(currentContext()); > + if (currentDeclaration()) { > + Q_ASSERT(currentContext()); > + currentDeclaration()->setInternalContext(currentContext()); > + } > return ret; > } > > > --001a11c373e418ed3704e7a165f7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
no unit test? :D


<= div class=3D"gmail_quote">On Tue, Oct 1, 2013 at 12:11 AM, Milian Wolff <mai= l@milianw.de> wrote:
Git commit 29a72f5c1234f1a47404e02d763da923b= e97fb58 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 =C2=A0+4 =C2=A0 =C2=A0-3 =C2=A0 =C2=A0duchain/declarationbuilder.cpp

http://commits.kde.org/kdev-qmljs/29a72f5c123= 4f1a47404e02d763da923be97fb58

diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cp= p
index 0d0bf93..44d85d7 100644
--- a/duchain/declarationbuilder.cpp
+++ b/duchain/declarationbuilder.cpp
@@ -185,9 +185,10 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiObjectIni= tializer* node)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0bool ret =3D DeclarationBuilderBase::visit(node);
=C2=A0 =C2=A0 =C2=A0DUChainWriteLocker lock;
- =C2=A0 =C2=A0Q_ASSERT(currentContext());
- =C2=A0 =C2=A0Q_ASSERT(currentDeclaration<ClassDeclaration>());
- =C2=A0 =C2=A0currentDeclaration()->setInternalContext(currentContext()= );
+ =C2=A0 =C2=A0if (currentDeclaration<ClassDeclaration>()) {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0Q_ASSERT(currentContext());
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0currentDeclaration()->setInternalContext(cu= rrentContext());
+ =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0return ret;
=C2=A0}



--001a11c373e418ed3704e7a165f7--