aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-06-15 16:41:24 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-18 18:24:34 +0000
commit5f162e17ed84a7af9c7b17a2538ed8b870685b8f (patch)
tree2394559a1ac3ff00780534a475b96c3e5b3e4d77 /src/qml/jsruntime/qv4engine.cpp
parentbc045ae542603b941f61b7f76a7a09a5c8877619 (diff)
Cleanup retrieval of scope and context objects
Change-Id: I9c6174181f950bc4f829727dc6acdfe82fa4e894 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 3d541e53a3..016187f488 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -720,7 +720,7 @@ Heap::Object *ExecutionEngine::newForEachIteratorObject(Object *o)
return obj->d();
}
-Heap::Object *ExecutionEngine::qmlContextObject() const
+Heap::QmlContextWrapper *ExecutionEngine::qmlContextObject() const
{
Heap::ExecutionContext *ctx = currentContext();
@@ -741,6 +741,18 @@ Heap::Object *ExecutionEngine::qmlContextObject() const
return static_cast<Heap::QmlContext *>(ctx)->qml;
}
+QObject *ExecutionEngine::qmlScopeObject() const
+{
+ return qmlContextObject()->scopeObject;
+}
+
+QQmlContextData *ExecutionEngine::callingQmlContext() const
+{
+ Heap::QmlContextWrapper *w = qmlContextObject();
+
+ return w ? w->context.contextData() : 0;
+}
+
QVector<StackFrame> ExecutionEngine::stackTrace(int frameLimit) const
{
Scope scope(const_cast<ExecutionEngine *>(this));