Security Demands Simplicity (was: Private Slots)

Brandon Benvie brandon at brandonbenvie.com
Sun Jan 20 16:42:14 PST 2013


On Sunday, January 20, 2013, Allen Wirfs-Brock wrote:
>
> I'm not sure if you are getting at something other than what I've
> described above.  If a @@DateValue private symbol is actually used as the
> implementation of [[DateValue]] then actuality that would happen.
>

I explored implementing [[DateValue]], [[NumberValue]], etc. as symbols
e.g. @@DateValue, but this causes observably different behavior from what
is specified with a.) inheritance, and b.) interaction with proxies.

    Object.create(new Date).getDate(); // works but is specified to not work

    new Proxy(new Date, {}).getDate(); // works but is specified to not work

Since Proxy is new in ES6 this of course can still be fixed, but to make
the first case work would be a (probably benign) backward incompatible
change and isn't going to work cross-engine unless the spec is changed to
explicitly allow/require it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130120/d69a42a0/attachment-0001.html>


More information about the es-discuss mailing list