diff options
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlbinding.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 6 |
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; |