Joshua reviewed existing "ugly" prototype approachs such as simple inheritance without super calls, broken attempts at adding super class calling, hard coded super calling, Douglas Crockford's strategy proposed in "Classical Inheritance in JavaScript" (which he found broken and also slow), and finally, a dynamic super calling approach which is fast and works.
This final design leverages a little known feature in JavaScript, although one that is supported by all major browsers. During the execution of any function, you can refer to the arguments that were passed in via the 'arguments' array. That's fairly well known, but the lesser known detail is that the 'arguments' array contains a reference in the property 'callee', which points to the current function that is being executed. This is important, because it's the only way that you can get such a reference since the function reference available via the 'this' object, always refers to the overridden function that is defined in the class at the top of the hierarchy.Earlier this year, Dean Edwards published specialized base class for doing OO in Javascript that also addresses these problems and is being considered for inclusion in 2.x versions of the popular Prototype Javascript framework.