Michael Theriot (2016-04-03T07:11:20.000Z)
michael.lee.theriot at gmail.com (2016-04-03T07:14:02.697Z)
That is good news then. I think I have the right expectations of proxies now. Sharing one handler is easy too. All you need to do is map both the `proxy` and its `target` to the same data. `receiver` is actually the proxy but the argument is no longer important here. ```js var priv = new WeakMap(); var handler = { get: (target, property, receiver) => property in priv.get(target) ? priv.get(target)[property] : target[property], set: (target, property, value, receiver) => property in priv.get(target) ? priv.get(target)[property] = value : target[property] = value, has: (target, property) => property in priv.get(target) || property in target }; function A() { let proxy = new Proxy(this, handler); let store = {secret: 4}; priv.set(this, store).set(proxy, store); return proxy; } A.prototype.getSecret = function () { return priv.get(this).secret; }; var a = new A(); a.getSecret(); // 4 a.secret; // 4 a.secret = 5; a.secret; // 5 a.getSecret(); // 5 'secret' in a; // true ``` (sorry for any dupes, new to mailing lists...)