From 002a5d4303b3b182ae4abc4a752c49787c1c2821 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 15 Jan 2015 11:36:57 +0100 Subject: Get rid of most uses of ValueRef Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmljavascriptexpression.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qml/qml/qqmljavascriptexpression.cpp') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 5f8190b8dc..447ee76952 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -106,7 +106,7 @@ void QQmlJavaScriptExpression::resetNotifyOnValueChanged() } QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, - const QV4::ValueRef function, bool *isUndefined) + const QV4::Value &function, bool *isUndefined) { QV4::ExecutionEngine *v4 = QV8Engine::getV4(context->engine); QV4::Scope scope(v4); @@ -116,13 +116,13 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, } QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, - const QV4::ValueRef function, + const QV4::Value &function, QV4::CallData *callData, bool *isUndefined) { Q_ASSERT(context && context->engine); - if (function->isUndefined()) { + if (function.isUndefined()) { if (isUndefined) *isUndefined = true; return QV4::Encode::undefined(); @@ -154,7 +154,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, callData->thisObject = value; } - result = function->asFunctionObject()->call(callData); + result = function.asFunctionObject()->call(callData); if (scope.hasException()) { if (watcher.wasDeleted()) scope.engine->catchException(); // ignore exception -- cgit v1.2.3