You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I already read the FAQ regarding this, but private members are possible, and it'd be nice to (optionally) have them at runtime.
Use Cases
So people interacting with your code at runtime experience the restrictions we desired them to have. They might not use TypeScript.
Examples
See lowclass (look at the extensive tests files showing all sorts of uses of runtime public/protected/private members). The implementation is not long, and some features can be omitted in order just to have the minimal protected/private functionality.
It uses WeakMaps to store protected/private state.
Suggestion
I already read the FAQ regarding this, but private members are possible, and it'd be nice to (optionally) have them at runtime.
Use Cases
So people interacting with your code at runtime experience the restrictions we desired them to have. They might not use TypeScript.
Examples
See
lowclass
(look at the extensive tests files showing all sorts of uses of runtime public/protected/private members). The implementation is not long, and some features can be omitted in order just to have the minimal protected/private functionality.It uses WeakMaps to store protected/private state.
Babel also has private member feature.
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: