aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4sparsearray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4sparsearray.cpp')
-rw-r--r--src/qml/jsruntime/qv4sparsearray.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4sparsearray.cpp b/src/qml/jsruntime/qv4sparsearray.cpp
index f21855ebc9..faa2f310ed 100644
--- a/src/qml/jsruntime/qv4sparsearray.cpp
+++ b/src/qml/jsruntime/qv4sparsearray.cpp
@@ -61,13 +61,15 @@ bool ArrayElementLessThan::operator()(const Property &p1, const Property &p2) co
if (p2.value.isUndefined())
return true;
if (Object *o = m_comparefn.asObject()) {
- ScopedCallData callData(o->engine(), 2);
+ Scope scope(o->engine());
+ ScopedValue result(scope);
+ ScopedCallData callData(scope, 2);
callData->thisObject = Value::undefinedValue();
callData->args[0] = p1.value;
callData->args[1] = p2.value;
- Value result = Value::undefinedValue();
- __qmljs_call_value(m_context, &result, QV4::ValueRef::fromRawValue(&m_comparefn), callData);
- return result.toNumber() <= 0;
+ result = __qmljs_call_value(m_context, QV4::ValueRef::fromRawValue(&m_comparefn), callData);
+
+ return result->toNumber() <= 0;
}
return p1.value.toString(m_context)->toQString() < p2.value.toString(m_context)->toQString();
}