Fix sameValue() for integer vs double 0
authorLars Knoll <lars.knoll@digia.com>
Mon, 14 Jan 2013 21:44:38 +0000 (22:44 +0100)
committerLars Knoll <lars.knoll@digia.com>
Tue, 15 Jan 2013 14:16:21 +0000 (15:16 +0100)
Change-Id: Id56699a3e3624c644b14c6ece847a91da0ea7004
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qmljs_value.cpp

index 9ea4be1..78c549f 100644 (file)
@@ -84,6 +84,10 @@ bool Value::sameValue(Value other) {
         return true;
     if (isString() && other.isString())
         return stringValue()->isEqualTo(other.stringValue());
+    if (isInteger() && int_32 == 0 && other.dbl == 0)
+        return true;
+    if (dbl == 0 && other.isInteger() && other.int_32 == 0)
+        return true;
     return false;
 }