Change Base.merge so that it produces a new hash and merges all passed hashes into it in sequence.

This commit is contained in:
Jürg Lehni 2011-06-20 20:24:33 +01:00
parent 3aff54517e
commit 54964907dd

View file

@ -99,10 +99,12 @@ this.Base = Base.inject({
}
},
merge: function(dest, src) {
return Base.each(src, function(value, key) {
this[key] = value;
}, dest);
merge: function() {
return Base.each(arguments, function(hash) {
Base.each(hash, function(value, key) {
this[key] = value;
}, this);
}, {}, true); // Pass true for asArray.
},
/**