Re: EcmaScript Proposal – Private methods and fields proposals.

Sultan thysultan at gmail.com
Thu Apr 12 21:33:35 UTC 2018


This is specifically an alternative to the current proposals around private
methods/fields. Specifically motivated by some of the issues discussed in
https://github.com/tc39/proposal-private-methods/issues/28

On Fri, Apr 13, 2018 at 12:13 AM, Isiah Meadows <isiahmeadows at gmail.com>
wrote:

> This is already being worked on:
>
> - Instance private fields/methods: https://github.com/tc39/
> proposal-class-fields
> - Static private fields/methods:
> https://github.com/tc39/proposal-static-class-features/
> - Recent TC39 meeting:
> https://esdiscuss.org/notes/2018-03-21#10ivb-javascript-classes-11
>
> -----
>
> Isiah Meadows
> me at isiahmeadows.com
>
> Looking for web consulting? Or a new website?
> Send me an email and we can get started.
> www.isiahmeadows.com
>
>
> On Thu, Apr 12, 2018 at 2:11 PM, Sultan <thysultan at gmail.com> wrote:
> > [Strawman] Private methods and fields for JavaScript:
> > https://github.com/thysultan/proposal-private-methods-and-fields
> >
> > ```js
> >
> > class A {
> >   private id = Symbol('unique')
> >   equal(instance, property) {
> >     return private(this)[property] == private(instance)[property]
> >   }
> > }
> >
> > const x = new A()
> >
> > x.equal(x, 'id')
> >
> > ```
> >
> >
> > _______________________________________________
> > 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/20180413/7a060d9f/attachment.html>


More information about the es-discuss mailing list