- 
    
Bug
 - 
    Resolution: Done
 - 
    
P1: Critical
 - 
    5.6.2
 - 
    None
 - 
    Windows 10 x64, Qt 5.6.2 x86 MSVC2013.
 
- 
        64714ea431f2fd355ed27edc69dba4e992511e75
 
Code example:
console.log('"240000000000" == "3776798720"', "240000000000" == "3776798720"); console.log('"240000000000" === "3776798720"', "240000000000" === "3776798720"); console.log('"240000000000" === "3776798721"', "240000000000" === "3776798721");
Output:
qml: "240000000000" == "3776798720" true qml: "240000000000" === "3776798720" true qml: "240000000000" === "3776798721" false
It looks like string interpreted as (u)int32 and high byte lost:
240000000000 == 0x37E11D6000 3776798720 == 0xE11D6000
This bug also effects on objects:
var g = {}; var h = "240000000000"; g[h] = h + "BUG"; console.log(JSON.stringify(g, null, 2)); console.log(g["3776798720"], g["240000000000"]);
Output:
qml: {
  "3776798720": "240000000000BUG"
}
qml: 240000000000BUG 240000000000BUG
As you can see the key is damaged. The value can be obtained by two different strings.
- is duplicated by
 - 
                    
QTBUG-59838 String comparison broken in QML
-         
     - Closed
 
 -