From c734706c69ed5b38cc97aea5be3f0553c194aa0a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 30 May 2012 10:24:14 +1000 Subject: 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 --- src/qml/qml/qqmlbinding.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/qml/qml/qqmlbinding.cpp') 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(); } -- cgit v1.2.3