So it seems that this function is where the attention should be focused on. Right?
Code javascript:
arrangeData: function(data){
var newData = $A();
var newHash = $H();
data.each(function(element){
newData.push(element.key);
newData.push(element.value.to);
}, this);
newData = newData.flatten().uniq().compact();
newData.each(function(item){
newHash.set(item, this._elementsWithRelations.get(item));
}, this);
return newHash;
},
Were you aware that objects like Hash sets, cannot guarantee to maintain the relative ordering of its objects?
From the Quirksmode - Associative page.
Note that JavaScript doesn't guarantee any particular order for the properties. So you cannot expect the property that was defined first to appear first, it might come last.
Bookmarks