New: proposal-common-member-modifiers
Ranando King
kingmph at gmail.com
Sun Dec 2 20:14:51 UTC 2018
I get that decorators "can" perform the same task, but these are features
that are standard in the language today. Once we start defining data
properties on classes, there will be an immediate need to define the
attributes of those properties. Yes, decorators can fill the need, but
unless a standard library is provided to perform these tasks, there will
certainly be multiple different takes on how such decorators should work.
By defining them directly into the language like this, not only do we get a
well defined approach to declaring properties with the desired attributes,
but we avoid the additional complexity of decorator implementation for an
otherwise trivial task.
...at least, that's how I'm thinking of it. I'm also working on 1 last
proposal, proposal-class-modifiers with the intent of adding `abstract` and
`final` to class declarations where `abstract class` would prevent
instantiation of the class and `final` class would prevent inheritance of
the class.
On Sun, Dec 2, 2018 at 2:31 AM Isiah Meadows <isiahmeadows at gmail.com> wrote:
> For one token (+ an import) more, you could use decorators instead.
> And BTW, it's been suggested already that a standard decorator library
> should exist, just IIUC (I'm not part of TC39) it's not yet determined
> what should be in it.
>
> -----
>
> Isiah Meadows
> contact at isiahmeadows.com
> www.isiahmeadows.com
>
> On Sun, Dec 2, 2018 at 2:25 AM Jacob Pratt <jhprattdev at gmail.com> wrote:
> >
> > I'm of the opinion this is what decorators are for.
> >
> > On Sun, Dec 2, 2018, 01:49 Ranando King <kingmph at gmail.com wrote:
> >>
> >> Since some form of data is going to land in ES class syntax, it would
> be a good idea if the capabilities of a property descriptor were also
> exposed for all public properties.
> >>
> >> https://github.com/rdking/proposal-common-member-modifiers
> >> _______________________________________________
> >> es-discuss mailing list
> >> es-discuss at mozilla.org
> >> https://mail.mozilla.org/listinfo/es-discuss
> >
> > _______________________________________________
> > 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/20181202/0dfad43b/attachment.html>
More information about the es-discuss
mailing list