proposal-class-fields
proposal-class-fields copied to clipboard
Documentation needed: Mechanics of how an inner class can access private names of the outer class is unclear
If I'm reading the spec correctly AllPrivateIdentifiersValid
will validate correctly for the outer class but not for the inner class. Is this intended behavior or a spec bug?
The valid set of private names inherits from the outer environment. See https://tc39.github.io/proposal-class-fields/#sec-all-private-identifiers-valid :
Let newNames be the concatenation of names with PrivateBoundIdentifiers of ClassBody.
Probably we should add a note in the spec to clarify, since you're not the first person to ask.
PRs welcome to add this note! cc @tjcrowder
@littledan - If no one gets there first, I've added it to my queue. I'll be working through queue items from Monday.
You all are lucky you can work on such things, on a Monday. I have only short evenings and mostly weekends if I choose to voice any opinions on this sort of stuff, when I'm not working my regular job. It can cut into the limited time I have outside of work.
Please, don't rush specs, and try turning the hundreds of downvotes into upvotes.