summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-22 08:16:47 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-22 08:16:47 (GMT)
commitba602c39e2ab7c16dcb212c935dbacdf053c6623 (patch)
treeafefdb2249373860a370fb6b92800787d9842da8 /src/declarative/qml
parent95e370e53e24cf4210bdea07022a7c4d94cd8854 (diff)
downloadQt-ba602c39e2ab7c16dcb212c935dbacdf053c6623.zip
Qt-ba602c39e2ab7c16dcb212c935dbacdf053c6623.tar.gz
Qt-ba602c39e2ab7c16dcb212c935dbacdf053c6623.tar.bz2
Fix test failures.
Also add a test for script errors within signal handlers.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlbinding.cpp6
-rw-r--r--src/declarative/qml/qmlexpression.cpp6
-rw-r--r--src/declarative/qml/qmlvme.cpp6
3 files changed, 13 insertions, 5 deletions
diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp
index 2b4e723..65ff789 100644
--- a/src/declarative/qml/qmlbinding.cpp
+++ b/src/declarative/qml/qmlbinding.cpp
@@ -128,8 +128,10 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags)
idx, a);
} else {
- QVariant value = this->value();
- if (data->property.object() && !data->property.write(value, flags)) {
+ bool undefined = false;
+ QVariant value = this->value(&undefined);
+
+ if (!undefined && data->property.object() && !data->property.write(value, flags)) {
QString fileName = data->fileName;
int line = data->line;
if (fileName.isEmpty()) fileName = QLatin1String("<Unknown File>");
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index d2bf4a8..7f01f0e 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -319,10 +319,12 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
QScriptValue svalue = data->expressionFunction.call();
if (isUndefined)
- *isUndefined = svalue.isUndefined();
+ *isUndefined = svalue.isUndefined() || scriptEngine->hasUncaughtException();
- if (scriptEngine->hasUncaughtException())
+ if (scriptEngine->hasUncaughtException()) {
printException(scriptEngine);
+ return QVariant();
+ }
if (secondaryScope)
ctxtPriv->defaultObjects.removeAt(ctxtPriv->highPriorityCount);
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index 7f673a2..fc19ebd2 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -540,7 +540,11 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt,
QMetaMethod signal =
target->metaObject()->method(instr.storeSignal.signalIndex);
- (void *)new QmlBoundSignal(ctxt, primitives.at(instr.storeSignal.value), target, signal, target);
+ QmlBoundSignal *bs = new QmlBoundSignal(target, signal, target);
+ QmlExpression *expr =
+ new QmlExpression(ctxt, primitives.at(instr.storeSignal.value), target);
+ expr->setSourceLocation(comp->url, instr.line);
+ bs->setExpression(expr);
}
break;