if (lhs == rhs)
return true;
+ if (lhs.IsEmpty() || rhs.IsEmpty())
+ return false;
+
QV8ObjectResource *lhsr = static_cast<QV8ObjectResource*>(lhs->GetExternalResource());
QV8ObjectResource *rhsr = static_cast<QV8ObjectResource*>(rhs->GetExternalResource());
- Q_ASSERT(lhsr->engine == rhsr->engine);
-
if (lhsr && rhsr) {
+ Q_ASSERT(lhsr->engine == rhsr->engine);
QV8ObjectResource::ResourceType lhst = lhsr->resourceType();
QV8ObjectResource::ResourceType rhst = rhsr->resourceType();
--- /dev/null
+import QtQuick 2.0
+
+Item {
+ property variant somepoint: Qt.point(1,2)
+ property variant randomjsobj: {"some": 1, "thing": 2}
+ property bool test1: somepoint != randomjsobj
+
+ property variant similar: {"x":1, "y":2}
+ property bool test2: somepoint != similar
+}
void returnValues();
void varAssignment();
void bindingsSpliceCorrectly();
+ void nonValueTypeComparison();
private:
QDeclarativeEngine engine;
}
}
+void tst_qdeclarativevaluetypes::nonValueTypeComparison()
+{
+ QDeclarativeComponent component(&engine, testFileUrl("nonValueTypeComparison.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+
+ delete object;
+}
+
QTEST_MAIN(tst_qdeclarativevaluetypes)
#include "tst_qdeclarativevaluetypes.moc"