>Unfortunately, we can't use a magic method name.  Just to throw out a couple 
>of other ideas though: 

>Contextual keyword after constructor:
>
>    class C {
>      constructor() { /* new me */ }
>      constructor call() { /* call me */ }
>    }

This one looks like the most readable — I would make a slight adjustment:

    class C {
      constructor() { /* new me *. }
      call constructor() { /* call me */ }
    }

(just for the purpose of readability)

I think it might be hard to mix this up with computed property names, so `call 
[‘constructor’]()` might be a no-go? same with `[‘constructor’] call()` tbh

> On Mar 30, 2015, at 12:20 PM, Kevin Smith <zenpars...@gmail.com> wrote:
> 
> I like the idea of a special syntactic form a lot. One of the nice things 
> about `constructor` is that it's easy to explain "you [[Construct]] with the 
> constructor". We can't use `call` similarly any more, but I totally agree 
> something like it would be pretty nice.
> 
> Unfortunately, we can't use a magic method name.  Just to throw out a couple 
> of other ideas though: 
> 
> Parens sans method name:
> 
>     class C {
>       constructor() { /* new me */ }
>       () { /* call me */ }
>     }
> 
> Contextual keyword after constructor:
> 
>     class C {
>       constructor() { /* new me */ }
>       constructor call() { /* call me */ }
>     }
> 
> With a "dot" instead:
> 
>     class C {
>       constructor() { /* new me */ }
>       constructor.call() { /* call me */ }
>     }
> 
> 

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to