On 9/28/07, Matt Foster <[EMAIL PROTECTED]> wrote: > > > What exactly is the "$super" argument and why does it always have the > dollar sign in front of it?
It has the dollar sign in front because "super" is a reserved keyword in JavaScript. "$super" was the next best thing. Prototype looks which instance methods have been declared with $super as first argument and then wraps those methods at class creation. When you invoke the "foo" instance method that has been declared with $super, a reference to the parent.foo method binded to the current object is pushed into the list of arguments. Thus, the same reference is available to the user through the $super special word. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
