diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-05-30 10:24:14 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-05 04:35:50 +0200 |
commit | c734706c69ed5b38cc97aea5be3f0553c194aa0a (patch) | |
tree | ec95a87fd3e3d9ad5d9b35c79b4beee291b99088 /src/qml/qml/qqmlbinding.cpp | |
parent | 751c1ca09305a15acc37cb28cb4687e1bb32e1d2 (diff) |
Delay conversion of v8 exceptions to QQmlErrors.
This conversion in relatively expensive, and not required for transient
exceptions that occur during startup due to the order of binding
evaluation.
Change-Id: I29a16c075890c8966c0bad0a77412ad232c791bb
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 81826d704d..38d305a64e 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -238,23 +238,18 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) trace.event("writing binding result"); - bool needsErrorData = false; + bool needsErrorLocationData = false; if (!watcher.wasDeleted() && !hasError()) - needsErrorData = !QQmlPropertyPrivate::writeBinding(*m_coreObject, m_core, context(), + needsErrorLocationData = !QQmlPropertyPrivate::writeBinding(*m_coreObject, m_core, context(), this, result, isUndefined, flags); if (!watcher.wasDeleted()) { - if (needsErrorData) { - QUrl url = QUrl(m_url); - - delayedError()->error.setUrl(url); - delayedError()->error.setLine(m_lineNumber); - delayedError()->error.setColumn(m_columnNumber); - } + if (needsErrorLocationData) + delayedError()->setErrorLocation(QUrl(m_url), m_lineNumber, m_columnNumber); if (hasError()) { - if (!delayedError()->addError(ep)) ep->warning(this->error()); + if (!delayedError()->addError(ep)) ep->warning(this->error(context()->engine)); } else { clearError(); } |