I‘am reading the source code of Function#methodize() (version1.7).
But I can't quite understand it.
1. How can a function apply to null? code: return
__method.apply(null, a);
2. want does it mean "return this._methodized = function(){}"? Does
it mean"this._methodized = function(){}; return this._methodized?"
Here is the source code:
function methodize() {
if (this._methodized) return this._methodized;
var __method = this;
return this._methodized = function() {
var a = update([this], arguments);
return __method.apply(null, a);
};
}
Thanks a lot!
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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-scriptaculous?hl=en.