diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-09-30 08:46:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-30 18:21:53 +0200 |
commit | fb89bc5635c09cab0d737ffd17de5f17d797373a (patch) | |
tree | 07ac21b6228b48941bb380cae2938d2c38e25cbd /src/qml/compiler | |
parent | 5b6687b7d94eb8ad140a2c150d3c978fe4d0af17 (diff) |
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 <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qqmlcodegenerator.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index 84bab99a52..b257d2d44e 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"))); |