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 <[email protected]> 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 > [email protected] > > 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 <[email protected]> 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 > > [email protected] > > https://mail.mozilla.org/listinfo/es-discuss > > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

