-
Notifications
You must be signed in to change notification settings - Fork 113
Backwards compatibility issue with private # sigil. #128
Comments
Afaik the proposal doesn't affect this syntax. The code above will still work after this proposal is implemented. |
Indeed, this isn't an issue precisely because private fields can only use dot access. |
See faq. |
This may not be an issue but it is clear that intuition led the poster to suspect this should work due to # syntax, which is an issue? |
I don’t see it as an issue, i see it as something someone will have to learn once. |
I respect that is consensus of TC39. I think developer consensus would be valuable too. |
I don't really see this as a compatibility issue, as it's not about how existing code works. Unfortunately, this syntax is sort of at odds with privacy itself; we have considered other syntaxes like |
Consider the following class definition:
Currently this value can be accessed from outside the instance:
If the # sigil syntax follows current member referencing standards, such that object members can both be accessed directly using the dot operator (if a valid identifier) and using a string literal, then currently accessible members can become inaccessible when this proposal is implemented.
The text was updated successfully, but these errors were encountered: