diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-05-21 09:27:43 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-24 00:55:55 +0200 |
commit | 0853343c33e394f35c31c161b019b2aed17f9256 (patch) | |
tree | 3f792f58979ae75f8e75a0c0ef6e7f89265b1c16 /src/qml/qml/qqmljavascriptexpression.cpp | |
parent | 9ee6bb0e14d968647350683eafbe80eed7a27058 (diff) |
Avoid dynamic lookup of signal handler arguments
Rewrite signal handlers to include the parameters
in the rewrite. Also check whether parameters are
actually used when possible, and if not don't
provide them to the expression.
Change-Id: I7d65c05f4639979dd61035cf7478119ef7647c25
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 650123bb8c..c72ca545f4 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -124,6 +124,15 @@ v8::Local<v8::Value> QQmlJavaScriptExpression::evaluate(QQmlContextData *context, v8::Handle<v8::Function> function, bool *isUndefined) { + return evaluate(context, function, 0, 0, isUndefined); +} + +v8::Local<v8::Value> +QQmlJavaScriptExpression::evaluate(QQmlContextData *context, + v8::Handle<v8::Function> function, + int argc, v8::Handle<v8::Value> args[], + bool *isUndefined) +{ Q_ASSERT(context && context->engine); if (function.IsEmpty() || function->IsUndefined()) { @@ -168,7 +177,7 @@ QQmlJavaScriptExpression::evaluate(QQmlContextData *context, if (value->IsObject()) This = v8::Handle<v8::Object>::Cast(value); } - result = function->Call(This, 0, 0); + result = function->Call(This, argc, args); if (isUndefined) *isUndefined = try_catch.HasCaught() || result->IsUndefined(); |