Are Private name and Weak Map the same feature? and the Assoc API

Brendan Eich brendan at mozilla.com
Fri Dec 16 13:03:09 PST 2011


From: "David Bruant" <bruant.d at gmail.com>
> ** if I trust a proxy, I share a: 

Stop right there. You don't know whether another object passed to you is a proxy or not. You cannot tell, in general. Nor should you have to care! Requiring you to care in order to avoid leaking private names is incredibly error-prone.

Again, private-named properties are "in" and "own", so proxies' handler traps should see something corresponding to them as property names. But leaks must be ruled out by design.

You can think of the p.public idea as analogus to public key encryption. By itself the (unique identity of the frozen) public key object discloses nothing and is not useful. Only if the proxy can access the private name and map from its .public object reference back to the private name can the proxy "decrypt".

/be


More information about the es-discuss mailing list