argumentNames just returns the names of the arguments passed to the
function. ForEx you have

function foo(bar, baz, qux) {
  alert("bar: " + bar + ", baz: " + baz + ", qux: " + qux);
}

foo.argumentNames() will return ["bar", "baz", "qux"], just as you
declared them on the function.

=====

methodize takes a function and returns a function that does the same,
but without the first parameter, which "turns" into the value of this
inside the function. Probably that explanation doesn't make much
sense, being almost 4am here :-P Example:

Math.sin = function(x) {
  // calculate the sine of x and return it.
}

Number.prototype.sin = Math.sin.methodize();

And now you can call (x).sin(); Try (Math.PI / 2).sin(), (0).sin(), etc :)

Best,
-Nicolas

On Nov 30, 2007 3:19 AM, John-David Dalton <[EMAIL PROTECTED]> wrote:
>
> Hello All,
>
> I was reading an article about the '$super' bug in compressed
> Prototype 1.6 and noticed a method I had not seen before:
> myFunc.argumentNames();
>
> Then when digging through the code I saw myFunc.methodize() as well
> (maybe its for internal use only, would still be cool to know what it
> does.)
>
> Thanks guys :)
>
> - John-David Dalton.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to