diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-19 13:17:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 78b49cf8361b1462cc94a061916a15f0b98e27e3 (patch) | |
tree | 01ac33be8df5d1cf2801ed34275d22bff7934e62 /src/qml/jsruntime/qv4sparsearray.cpp | |
parent | a9bdc91cefabb3729d0240fce4c01a669be09dbf (diff) |
Convert the last methods in qv4object_p.h
Change-Id: I4fda83a0832760c277e629d4e658da718c0bf92b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4sparsearray.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4sparsearray.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4sparsearray.cpp b/src/qml/jsruntime/qv4sparsearray.cpp index faa2f310ed..a001dc276b 100644 --- a/src/qml/jsruntime/qv4sparsearray.cpp +++ b/src/qml/jsruntime/qv4sparsearray.cpp @@ -55,19 +55,21 @@ using namespace QV4; bool ArrayElementLessThan::operator()(const Property &p1, const Property &p2) const { + Scope scope(m_context); if (p1.value.isUndefined()) return false; if (p2.value.isUndefined()) return true; - if (Object *o = m_comparefn.asObject()) { + ScopedObject o(scope, m_comparefn); + if (o) { 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; - result = __qmljs_call_value(m_context, QV4::ValueRef::fromRawValue(&m_comparefn), callData); + result = __qmljs_call_value(m_context, m_comparefn, callData); return result->toNumber() <= 0; } |