Skip to content

Instantly share code, notes, and snippets.

@philogb
Created November 9, 2010 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philogb/669718 to your computer and use it in GitHub Desktop.
Save philogb/669718 to your computer and use it in GitHub Desktop.
add : function(key, o){
if(arguments.length == 1){
o = key;
key = this.getKey(o);
debugger;
}
if(typeof key != 'undefined' && key !== null){
var old = this.map[key];
if(typeof old != 'undefined'){
return this.replace(key, o);
}
this.map[key] = o;
}
this.length++;
this.items.push(o);
this.keys.push(key);
this.fireEvent('add', this.length-1, o, key);
return o;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment