PDA

View Full Version : MixedCollection.addAll bug



GamePimp
13 Jun 2007, 7:25 AM
It looks like there's a bug in MixedCollection.addAll (ext-1.0.1a) when passing in an object. Seems like the call to add has the arguments reversed.



addAll : function(objs){
if(arguments.length > 1 || objs instanceof Array){
var args = arguments.length > 1 ? arguments : objs;
for(var i = 0, len = args.length; i < len; i++){
this.add(args[i]);
}
}else{
for(var key in objs){
if(this.allowFunctions || typeof objs[key] != "function"){
this.add(objs[key], key);
}
}
}
},
I believe the line to call add should be:
this.add(key, objs[key]);

jack.slocum
13 Jun 2007, 9:22 AM
Looks good - I will make the change.