From 0d8deae65ed07b4a89d5a6b4a9f04201db07809a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 14 Jan 2013 22:44:38 +0100 Subject: [PATCH] Fix sameValue() for integer vs double 0 Change-Id: Id56699a3e3624c644b14c6ece847a91da0ea7004 Reviewed-by: Simon Hausmann --- qmljs_value.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmljs_value.cpp b/qmljs_value.cpp index 9ea4be1..78c549f 100644 --- a/qmljs_value.cpp +++ b/qmljs_value.cpp @@ -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; } -- 2.7.4