Has it ever been proposed to change Object.extend() to accept multiple
sources?
For example, instead of:
Object.extend(Object.extend(Ajax.Updater.prototype,
Ajax.Request.prototype), {...}));
do the following:
Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype, {...});
Here is a quick example rewrite:
Object.extend = function() {
var sources = $A(arguments), destination = sources.shift();
sources.each(function(source) {
for (var property in source) {
destination[property] = source[property];
}
});
return destination;
}
Would core be interested in such a patch, or is there some drawbacks I'm
missing? Too much overhead maybe?
-- Ken Snyder
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---