aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-10-09 09:37:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 22:55:08 +0200
commit28f67263a181e2d99b2c240f9d698bf64100ac92 (patch)
tree3c7c6287e00d6032ff53a78b7a9b0caa51cc9d23 /src/qml/qml/qqmlvme.cpp
parent774963f52f569e637f45d6c6079121253e54b61b (diff)
Compile signal handler expressions in the loader thread
Handle them similar to function declarations, except that we need to synthesize the expression into a function declaration that includes the signal parameter names. This is done quite similar to the code path in the new compiler. Change-Id: I751081f7f1052692da6e2ed60c7f5c017372d829 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r--src/qml/qml/qqmlvme.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 21f7ce4cab..c1c05fac11 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -777,13 +777,16 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
QObject *target = objects.top();
QObject *context = objects.at(objects.count() - 1 - instr.context);
+ QV4::ExecutionContext *qmlContext = qmlBindingContext(engine, QV8Engine::getV4(engine), qmlBindingWrappers, CTXT, context, objects.count() - 1 - instr.context);
+
+ QV4::Function *runtimeFunction = COMP->compilationUnit->runtimeFunctions[instr.runtimeFunctionIndex];
+
+ tmpValue = QV4::FunctionObject::creatScriptFunction(qmlContext, runtimeFunction);
+
QQmlBoundSignal *bs = new QQmlBoundSignal(target, instr.signalIndex, target, engine);
QQmlBoundSignalExpression *expr =
new QQmlBoundSignalExpression(target, instr.signalIndex,
- CTXT, context, PRIMITIVES.at(instr.value),
- COMP->name, instr.line, instr.column,
- PRIMITIVES.at(instr.handlerName),
- PRIMITIVES.at(instr.parameters));
+ CTXT, context, tmpValue);
bs->takeExpression(expr);
QML_END_INSTR(StoreSignal)