aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-05 13:22:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-11 13:01:50 +0200
commit6e8e5d16e16d6ee683a5c06a24f8f202ed5239ff (patch)
treefa8e710ad0ee4ff6cc9738fa717883c74d452b95 /src/qml/qml/qqmljavascriptexpression.cpp
parent736afb8e9b3694efb8ca1fa8f3a8eeeaef530da2 (diff)
Move CallData onto the JS stack
Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 41be44a0a7..2974bbcfbe 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -47,6 +47,7 @@
#include <private/qv4functionobject_p.h>
#include <private/qv4script_p.h>
#include <private/qv4errorobject_p.h>
+#include <private/qv4scopedvalue_p.h>
QT_BEGIN_NAMESPACE
@@ -125,8 +126,7 @@ QV4::Value
QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
const QV4::Value &function, bool *isUndefined)
{
- QV4::Value args[QV4::Global::ReservedArgumentCount];
- return evaluate(context, function, 0, args, isUndefined);
+ return evaluate(context, function, 0, 0, isUndefined);
}
QV4::Value
@@ -173,11 +173,10 @@ QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
This = value;
}
- QV4::CallData d;
- d.thisObject = This;
- d.args = args;
- d.argc = argc;
- result = function.asFunctionObject()->call(d);
+ QV4::ScopedCallData callData(v4, argc);
+ callData->thisObject = This;
+ memcpy(callData->args, args, argc*sizeof(QV4::Value));
+ result = function.asFunctionObject()->call(callData);
if (isUndefined)
*isUndefined = result.isUndefined();