aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-27 09:45:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-30 08:05:46 +0200
commit0e36db9f1179d1bdf0710494e98ff7aee1a2d836 (patch)
treee9f00fe028ee24b4412e3bb8418a3381e81c772b /src/qml/qml/qqmljavascriptexpression.cpp
parent472c8e6bed0b18c4e853c905ace07a09c64c29d2 (diff)
Remove most uses of Value from qml/qml
Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 788d3e241c..938b14a15f 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -123,22 +123,26 @@ void QQmlJavaScriptExpression::resetNotifyOnValueChanged()
}
QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
- const QV4::Value &function, bool *isUndefined)
+ const QV4::ValueRef function, bool *isUndefined)
{
- return evaluate(context, function, 0, 0, isUndefined);
+ QV4::ExecutionEngine *v4 = QV8Engine::getV4(context->engine);
+ QV4::Scope scope(v4);
+ QV4::ScopedCallData callData(scope, 0);
+
+ return evaluate(context, function, callData, isUndefined);
}
QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
- const QV4::Value &function,
- int argc, QV4::Value *args,
+ const QV4::ValueRef function,
+ QV4::CallData *callData,
bool *isUndefined)
{
Q_ASSERT(context && context->engine);
- if (function.isUndefined()) {
+ if (function->isUndefined()) {
if (isUndefined)
*isUndefined = true;
- return QV4::Primitive::undefinedValue().asReturnedValue();
+ return QV4::Encode::undefined();
}
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context->engine);
@@ -165,7 +169,6 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
QV4::ScopedValue result(scope, QV4::Primitive::undefinedValue());
QV4::ExecutionContext *ctx = v4->current;
try {
- QV4::ScopedCallData callData(scope, argc);
callData->thisObject = ep->v8engine()->global();
if (scopeObject() && requiresThisObject()) {
QV4::ScopedValue value(scope, QV4::QObjectWrapper::wrap(ctx->engine, scopeObject()));
@@ -173,8 +176,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
callData->thisObject = value;
}
- memcpy(callData->args, args, argc*sizeof(QV4::Value));
- result = function.asFunctionObject()->call(callData);
+ result = function->asFunctionObject()->call(callData);
if (isUndefined)
*isUndefined = result->isUndefined();