aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-18 15:48:18 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-19 12:12:35 +0000
commitef6469a95948b8c95ed6fb0cbbe7daaa1960c956 (patch)
tree330819561d5f3fd1d96c5c5f87f720024c97e454 /src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
parenta5626dbe6769af2ccf7089d2ae7ef58f76f75ea5 (diff)
VME Method object data cleanup
Get rid of the redundant MethodData meta-data that is stored per-type. Change-Id: I9faa284bdd0c9f0c9ebb3c66905ab5e34a9ee3a4 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index ff4e30835d..e08436b7a3 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -766,9 +766,14 @@ bool QQmlEngineDebugServiceImpl::setMethodBody(int objectId, const QString &meth
QQmlVMEMetaObject *vmeMetaObject = QQmlVMEMetaObject::get(object);
Q_ASSERT(vmeMetaObject); // the fact we found the property above should guarentee this
- int lineNumber = vmeMetaObject->vmeMethodLineNumber(prop->coreIndex);
QV4::ExecutionEngine *v4 = QV8Engine::getV4(qmlEngine(object)->handle());
QV4::Scope scope(v4);
+
+ int lineNumber = 0;
+ QV4::ScopedFunctionObject oldMethod(scope, vmeMetaObject->vmeMethod(prop->coreIndex));
+ if (oldMethod && oldMethod->d()->function) {
+ lineNumber = oldMethod->d()->function->compiledFunction->location.line;
+ }
QV4::ScopedValue v(scope, QQmlJavaScriptExpression::evalFunction(contextData, object, jsfunction, contextData->urlString(), lineNumber));
vmeMetaObject->setVmeMethod(prop->coreIndex, v);
return true;