aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecompiler.cpp
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-01-27 11:19:50 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-27 08:42:06 +0100
commitcd9103f7f2514b6380aa460ac9d6454e132be307 (patch)
tree0d5f6edb396bb65172be2d7b6341f242e1d3c884 /src/declarative/qml/qdeclarativecompiler.cpp
parentfc973c6ca45bd55122b7e2af8d38c4c11ab044a1 (diff)
Improve QRegExp property literal assignment error message
Previously, the error message given when a string literal was assigned to a regular expression property was not very helpful. This commit adds a better error message. Task-number: QTBUG-23068 Change-Id: Ia57b6434b9cdf009429e7b55edab4ab5c2b91c2a Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/declarative/qml/qdeclarativecompiler.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 8bf1faa2f1..8a2d6abb7b 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -257,6 +257,9 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p
case QVariant::Url:
if (!v->value.isString()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: url expected"));
break;
+ case QVariant::RegExp:
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: regular expression expected; use /pattern/ syntax"));
+ break;
case QVariant::UInt:
{
bool ok = v->value.isNumber();