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.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4sparsearray.cpp b/src/qml/jsruntime/qv4sparsearray.cpp
index ec6b0f5ad1..3ee89d5b53 100644
--- a/src/qml/jsruntime/qv4sparsearray.cpp
+++ b/src/qml/jsruntime/qv4sparsearray.cpp
@@ -57,9 +57,9 @@ bool ArrayElementLessThan::operator()(const Property &p1, const Property &p2) co
{
Scope scope(m_context);
- if (p1.value.isUndefined())
+ if (p1.value.isUndefined() || p1.value.isEmpty())
return false;
- if (p2.value.isUndefined())
+ if (p2.value.isUndefined() || p2.value.isEmpty())
return true;
ScopedObject o(scope, m_comparefn);
if (o) {
@@ -71,7 +71,7 @@ bool ArrayElementLessThan::operator()(const Property &p1, const Property &p2) co
callData->args[1] = p2.value;
result = __qmljs_call_value(m_context, m_comparefn, callData);
- return result->toNumber() <= 0;
+ return result->toNumber() < 0;
}
ScopedString p1s(scope, p1.value.toString(m_context));
ScopedString p2s(scope, p2.value.toString(m_context));