Function.prototype.bind may work 2 times faster, if when calling bind
with one argument,it would return function without "arg.concat"
bind: function() {
if (arguments.length < 2 && Object.isUndefined(arguments[0]))
return this;
var __method = this, args = $A(arguments), object = args.shift();
if(arg.length)
return function() {
return __method.apply(object, concat($A(arguments)));
};
return function(){
return __method.apply(object, $A(arguments));
};
}
P.S. bind function used with one argument very frequently
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---