Proposal: Alternative public, private, static syntax and questions

Brandon Andrews warcraftthreeft at sbcglobal.net
Thu Jan 11 09:09:27 UTC 2018


I created a thread about static constructors a while ago here: https://esdiscuss.org/topic/proposal-for-a-static-constructor-and-static-member-variables It left me with some design thoughts so I wrote up the following proposal idea below, but never posted it because I couldn't understand why the current Stage 3 private proposal introduced a new token '#'. Maybe I missed something obvious in the design of the grammar or the way the internals work, but I didn't understand. Also I didn't understand why it does this.#x which seems verbose since every language with private members doesn't introduce this clutter. (It's like writing private everywhere you use it rather than one place which can't really be the simplest implementation right?).


https://github.com/sirisian/ecmascript-public-private-static

In the above proposal above I stuck with 'private' and 'static' keywords since it seems closer to other languages. Also I kept with the idea that default behavior is public to not introduce breaking changes. Can someone explain why ECMAScript can't use something like I proposed?


More information about the es-discuss mailing list