aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-10 12:34:36 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-16 10:56:03 +0000
commit497ccdc843975bfe20f5b24e083d17f01012efb9 (patch)
treeceba5b1b4e2716fe3d1ca005ac5d733fd36097c7 /src/qml/qml/qqmljavascriptexpression.cpp
parent5870667929ac5f45805b1e1e656fec81b9b22337 (diff)
Speed up binding evaluation
Don't spend any cycles of determining the location of the binding (file, line, column) unless we really need that information. That's the case when the profiler is active or an error happens. Change-Id: Iae97808d500b88fed6a813e8b224aa6ebe04d3b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 3ac0f23e4d..02bd1c4b83 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -40,6 +40,7 @@
#include <private/qv4script_p.h>
#include <private/qv4errorobject_p.h>
#include <private/qv4scopedvalue_p.h>
+#include <private/qqmlglobal_p.h>
QT_BEGIN_NAMESPACE
@@ -59,11 +60,11 @@ bool QQmlDelayedError::addError(QQmlEnginePrivate *e)
return true;
}
-void QQmlDelayedError::setErrorLocation(const QUrl &url, quint16 line, quint16 column)
+void QQmlDelayedError::setErrorLocation(const QQmlSourceLocation &sourceLocation)
{
- m_error.setUrl(url);
- m_error.setLine(line);
- m_error.setColumn(column);
+ m_error.setUrl(QUrl(sourceLocation.sourceFile));
+ m_error.setLine(sourceLocation.line);
+ m_error.setColumn(sourceLocation.column);
}
void QQmlDelayedError::setErrorDescription(const QString &description)