Add a sourceLocation() accessor to QV4::Function
Change-Id: I3a38ee44ce46c2416ceef153ce631bc15fd461fe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
e31e72925f
commit
83aa1933c8
|
@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue