Fix equalitySemantics sub-test in qqmlecmascript::sequenceConversionArray

Implement Managed::isEqualTo correctly

Change-Id: Ife4e2bf368037910614401e2ffa0c334b6581e30
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Simon Hausmann 2013-06-07 22:09:28 +02:00 committed by Lars Knoll
parent 84b62089b5
commit f39c93a9ff
1 changed files with 15 additions and 0 deletions

View File

@ -296,6 +296,19 @@ public:
return true;
}
bool containerIsEqualTo(Managed *other)
{
QQmlSequence<Container> *otherSequence = other->as<QQmlSequence<Container> >();
if (!otherSequence)
return false;
if (m_isReference && otherSequence->m_isReference) {
return m_object == otherSequence->m_object && m_propertyIndex == otherSequence->m_propertyIndex;
} else if (!m_isReference && !otherSequence->m_isReference) {
return this == otherSequence;
}
return false;
}
void sort(QV4::SimpleCallContext *ctx)
{
if (m_isReference) {
@ -443,6 +456,8 @@ private:
{ return static_cast<QQmlSequence<Container> *>(that)->containerQueryIndexed(ctx, index); }
static bool deleteIndexedProperty(QV4::Managed *that, QV4::ExecutionContext *ctx, uint index)
{ return static_cast<QQmlSequence<Container> *>(that)->containerDeleteIndexedProperty(ctx, index); }
static bool isEqualTo(Managed *that, Managed *other)
{ return static_cast<QQmlSequence<Container> *>(that)->containerIsEqualTo(other); }
static void destroy(Managed *that)
{