Re: Aren’t membranes incompatible with private data via WeakMaps?

2015-11-24 Thread Axel Rauschmayer
Thanks! I forgot about unwrapping. > On 22 Nov 2015, at 00:32, Mark S. Miller wrote: > > Answering the question in the subject line, no. The key is the difference > between a standalone proxy and a membrane. With a membrane, the key is that > the: > > * Countdown class >

Aren’t membranes incompatible with private data via WeakMaps?

2015-11-21 Thread Axel Rauschmayer
Take, for example, the following class, which uses WeakMaps for its private data: ```js let _counter = new WeakMap(); let _action = new WeakMap(); class Countdown { constructor(counter, action) { _counter.set(this, counter); _action.set(this, action); } dec() {

Re: Aren’t membranes incompatible with private data via WeakMaps?

2015-11-21 Thread Mark S. Miller
Answering the question in the subject line, no. The key is the difference between a standalone proxy and a membrane. With a membrane, the key is that the: * Countdown class * Countdown.prototype * Countdown.prototype.dec * instances of the Countdown class * the WeakMaps used by the Countdown