Share a secret across ES6 specific modules, so that other modules cannot access the secret?

2017-04-23 Thread /#!/JoePea
Is there a way to share some secret value across a few modules, and prevent other modules? f.e. prevent modules of an app dev who is importing modules of a library where the library wants to share private stuff across its modules. Is this possible to implement somehow? WeakMaps can be

Re: Share a secret across ES6 specific modules, so that other modules cannot access the secret?

2017-04-23 Thread Jordan Harband
Nope. This is exactly why it seems that "protected" couldn't have any way to work that has "hard" enforcement. The only true privacy in JS is via closure (including WeakMaps), or via the upcoming "private fields" proposal, assuming it stays as "hard private". Anything shared is publicly