Private symbols vs property attributes

Kevin Smith khs4473 at
Mon Feb 18 09:24:10 PST 2013

I think this proposal gets it right from privacy side of things, but the
interaction with proxies is not good.  Proxies would have to treat any
symbol as potentially naming a private property, and therefore all symbols
used by the object would have to be added to the proxy's whitelist when
wrapping the object.  The usability here is horrible.  If you added just
one symbol to the internal interface of an object, the whitelists at all
trusted proxy-creating sites would also have to be updated.

In fact, the same usability critique applies to the current private symbols
proposal as well.

Basically, "get" and "getPrivate" are two distinct operations from an MOP
perspective.  Private symbols are a kludge used to overload "get" based on
the type of symbol used as input.

Some points:

- ES6 is already chock-full of new features.
- In ES6, there are already multiple ways to "secure" object data.
- Private properties interact poorly with our current MOP, as evidenced by
proxy issues.

Let's not throw this private property kludge into ES6.

(I realize that using the word "kludge" is a bit baiting, but I
intentionally want to cast that light on it.)

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list