From: Simon Hausmann Date: Mon, 30 Sep 2013 06:46:45 +0000 (+0200) Subject: Fix error message for group property definitions on signals in new compiler X-Git-Tag: upstream/5.2.1~331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb89bc5635c09cab0d737ffd17de5f17d797373a;p=platform%2Fupstream%2Fqtdeclarative.git Fix error message for group property definitions on signals in new compiler It may happen that people forget the colon after the handler name in onSomeSignal { code here } and we have to print out the correct error message. It looks like a group property, but we can identify this binding due to its reserved use of starting with "on". Change-Id: I7c502c1a2a5f2a6c613879468a60bc57a7d20fe8 Reviewed-by: Lars Knoll --- diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index 84bab99..b257d2d 100644 --- a/src/qml/compiler/qqmlcodegenerator.cpp +++ b/src/qml/compiler/qqmlcodegenerator.cpp @@ -1221,12 +1221,13 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio continue; } - if (binding->type != QV4::CompiledData::Binding::Type_Script) - continue; - if (!QQmlCodeGenerator::isSignalPropertyName(propertyName)) continue; + if (binding->type != QV4::CompiledData::Binding::Type_Script) { + COMPILE_EXCEPTION(binding->location, tr("Incorrectly specified signal assignment")); + } + PropertyResolver resolver(propertyCache); Q_ASSERT(propertyName.startsWith(QStringLiteral("on")));