aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/jsruntime/qv4function_p.h6
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index 6e0ba9d764..12094a0943 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -51,6 +51,7 @@
//
#include "qv4global_p.h"
+#include <private/qqmlglobal_p.h>
#include <private/qv4compileddata_p.h>
QT_BEGIN_NAMESPACE
@@ -89,6 +90,11 @@ struct Q_QML_EXPORT Function {
inline bool needsActivation() const
{ return activationRequired; }
+ QQmlSourceLocation sourceLocation() const
+ {
+ return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);
+ }
+
};
}
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 28a9949464..8e84eaebe7 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -237,10 +237,8 @@ QQmlSourceLocation FunctionObject::sourceLocation() const
Q_ASSERT(as<const QV4::QQmlBindingFunction>());
return *static_cast<QV4::Heap::QQmlBindingFunction *>(d())->bindingLocation;
}
- QV4::Function *function = d()->function;
- Q_ASSERT(function);
- return QQmlSourceLocation(function->sourceFile(), function->compiledFunction->location.line, function->compiledFunction->location.column);
+ return d()->function->sourceLocation();
}
DEFINE_OBJECT_VTABLE(FunctionCtor);