Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Private (#) vs Class#prototypeProperty #34

Closed
stevenvachon opened this issue Aug 13, 2017 · 4 comments
Closed

Private (#) vs Class#prototypeProperty #34

stevenvachon opened this issue Aug 13, 2017 · 4 comments

Comments

@stevenvachon
Copy link

It causes confusion with things like Array#includes and Array#length.

@ljharb
Copy link
Member

ljharb commented Aug 13, 2017

That's always been a documentation-only convention, borrowed largely from Ruby - indeed a#b has been conventionally short for a.prototype.b, but that's not a really good argument against all the reasons that class fields need to be own properties.

@stevenvachon
Copy link
Author

stevenvachon commented Aug 13, 2017

Maybe we should use $, or _ like C#, then. I still don't like not being able to use private, though.

@ljharb
Copy link
Member

ljharb commented Aug 13, 2017

Neither of those are syntax; it has to be syntax to be hard-private. Give the private fields FAQ a read.

@littledan
Copy link
Member

Yes, this overlap is unfortunate, but I don't see a clear alternative.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants