I am pretty sure this is because of the way different JavaScript engines keep track of object properties internally. Take this for example:
var obj = {
"1" : "test",
"0" : "test 2"
};
for(var key in obj) {
console.log(key);
}
This will log 1, 0 in e.g. Firefox, but 0, 1 in V8 (Chrome and NodeJS).
So if you need to be deterministic, you will probably have to iterate through each key store it in an array, sort the array and then stringify each property separately by looping through that array.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…