Proposal for a static constructor and static member variables

Reinis Ivanovs dabas at untu.ms
Thu Jan 26 06:51:31 UTC 2017


Having a static constructor makes things more confusing, since now static
and instance constructors would need to be differentiated, and its value is
kind of unclear. Your example also doesn't make sense, since you're
accessing the static properties from the instance constructor using `this`,
which would refer to the instance, not the constructor.

On Thu, Jan 26, 2017 at 6:40 AM, Brandon Andrews <
warcraftthreeft at sbcglobal.net> wrote:

> The initial proposal for discussion is below:
>
>
> https://github.com/sirisian/ecmascript-static-constructor
>
> I don't believe this conflicts with other proposals yet, nor any future
> proposals. Essentially it adds static members in a very compact syntax with
> minimal grammar changes required.
>
> What I foresee happening years from now is public, private, and static
> member syntax will be added. Much like how public members are defined in
> the constructor for the moment the static constructor would be the way to
> define static members of the class for now.
>
> Thoughts?
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170126/8348491c/attachment.html>


More information about the es-discuss mailing list