Re:Implementing Private Fields for JavaScript
by Madeindjs on Sunday June 13, 2021 @05:08PM
(#27496512)
> `_` would cause compatibility issues with existing JavaScript code, which has allowed `_` at the start of an identifier or (public) property name for a long time. -- https://github.com/tc39/proposal-private-fields/blob/master/...
Re:Implementing Private Fields for JavaScript
by andy_ppp on Sunday June 13, 2021 @06:19AM
(#27491342)
Why can’t they just introduce a new private keyword, i.e. private let myVar = 0;
The proposal doesn’t even know.
I suspect there’s a risk that if the committee standardised on _ rather than #, it would actually break a load of older apps and content. There’s a good chance the _convention was abused in those earlier codebases.