super.apply(this, arguments)

Peter Hall peter.hall at memorphic.com
Thu Dec 20 10:31:27 PST 2007


I haven't tried this in the RI, but what about:

 var sup = super;
 sup.apply(this, arguments);


?

Peter

On Dec 20, 2007 6:05 PM, Jeff Dyer <jodyer at adobe.com> wrote:
> Sorry, I didn't mean to sound so flippant.
>
> As you may know, super expressions limit the binding of the name after the
> dot to the base class bindings. So the fragment above would call the super
> instance method 'apply', not the super constructor. We could give 'apply'
> some special meaning when the first argument is 'this', but the super
> constructor will have already been called during initialization.
>
> None of this means that the desired semantics wouldn't be possible to
> achieve with another syntax. My guess is that it would be somehow similar to
> the current super initializer syntax, which looks like this:
>
>    class A extends B {
>       function A(x,y,z) : super (x,y,z) { }
>    }
>
> Suggestion welcomed.
>
> Jd
>
>
> On 12/20/07 9:04 AM, Dean Edwards wrote:
>
> >> On 12/20/07 7:20 AM, P T Withington wrote:
> >>
> >>> Ok.  I didn't look in the wiki to start with because of that, hence I
> >>> ask on the list:  can I apply my super's constructor as in the subject
> >>> line?
> >>>
> > Jeff Dyer wrote:
> >> Sorry, but you can't.
> >>
> >
> > That's a shame.
> >
> > -dean
>
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>



More information about the Es4-discuss mailing list