On Tuesday 08 September 2009 14:56:06 Allen Madsen wrote:
> Hey TJ,
> For your two suggested additions. I don't think I have ever had a use for
> either. One thing I would like to suggest though is that Class.create take
> an object or a function as an argument. Since it is essentially a
> requirement now to use a function to create named functions that can call
> super (disregarding callee), it would be nice if defining that was
> simplified. So something like:
>
> var A = Class.create({
>   nifty: function(){}
> });
>
> var B = Class.create(A, function(){
>   function nifty(){
>     nifty.$super.call(this);
>   }
>
>   return {nifty: nifty};
> });

How about simplifying further:

var B = Class.create( A,
    function nifty(){
        nifty.$super.call(this);
    }

,   function alsoNifty(){
        this.nifty();
    }
);

Ie, Class.create takes any number of objects of functions or functions. If 
functions, the function name is used.

-- 
Jim
my wiki ajaxification thing: http://wikizzle.org
my blog: http://jimhigson.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
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 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to