Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private / protected class members #1

Open
ichiriac opened this issue Feb 4, 2017 · 2 comments
Open

private / protected class members #1

ichiriac opened this issue Feb 4, 2017 · 2 comments

Comments

@ichiriac
Copy link
Member

ichiriac commented Feb 4, 2017

In order to make an object property fully private. The closure method is not memory efficient, and not sure about JIT optimisations, but may be bad.

The symbol is a scope free way to index a private property on an object, the scope of the symbol instance beeing declared on the definition level and not a instanciation.

So real private is easy, but sharing protected symbols will be harder ... Question is still open.

@ichiriac
Copy link
Member Author

ichiriac commented Feb 4, 2017

The approach of typescript is different but not sure why
microsoft/TypeScript#13879

@ichiriac ichiriac self-assigned this Feb 4, 2017
@ichiriac ichiriac changed the title private / protected classes private / protected class members Feb 4, 2017
@ichiriac ichiriac added this to the First release milestone Mar 7, 2017
@ichiriac
Copy link
Member Author

ichiriac commented Mar 7, 2017

Take the same approach as TypeScript for protected values. For private values, as they are Class dependents, I'll find a way to avoid colisions between child/base classes (prefix with an arbitrary hash - low collision probability ?)

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

No branches or pull requests

1 participant