aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4function_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-14 13:56:18 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-08 18:34:02 +0000
commitf770cebdd3d6a7f31c21e1bf04d386178122bc84 (patch)
tree2100b0010eacdca66881a0f01df6ade52468bff7 /src/qml/jsruntime/qv4function_p.h
parent948bcdbc01a2c4a2df3eed187908b006f199ecc9 (diff)
Refactor the way we declare signal parameter names
Qml Connection objects where using an awkward way to make the parameter names of signals available to the signal handler. This now uses an approach that is equivalent to what we do with other functions. The main difference is that we can't know the parameter names at type compile time, so we have to rewrite the internal class of the QV4::Function at connect time. Change-Id: I5e538ac840b5a46ccb14ff71684404d947948324 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4function_p.h')
-rw-r--r--src/qml/jsruntime/qv4function_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index 10a03bca94..534aa1b750 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -49,11 +49,16 @@ struct Q_QML_EXPORT Function {
// first nArguments names in internalClass are the actual arguments
InternalClass *internalClass;
+ uint nFormals;
+ bool activationRequired;
Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function,
ReturnedValue (*codePtr)(ExecutionEngine *, const uchar *));
~Function();
+ // used when dynamically assigning signal handlers (QQmlConnection)
+ void updateInternalClass(ExecutionEngine *engine, const QList<QByteArray> &parameters);
+
inline Heap::String *name() {
return compilationUnit->runtimeStrings[compiledFunction->nameIndex];
}
@@ -64,7 +69,7 @@ struct Q_QML_EXPORT Function {
inline bool isNamedExpression() const { return compiledFunction->flags & CompiledData::Function::IsNamedExpression; }
inline bool needsActivation() const
- { return compiledFunction->nInnerFunctions > 0 || (compiledFunction->flags & (CompiledData::Function::HasDirectEval | CompiledData::Function::UsesArgumentsObject)); }
+ { return activationRequired; }
};