Security Demands Simplicity (was: Private Slots)

Kevin Smith khs4473 at gmail.com
Sat Jan 19 10:04:57 PST 2013


>
>
> It calls the unknownPrivateSymbol trap. If the trap throws, the operation
> fails. In all other cases (no trap or trap which doesn't throw), it's
> forwarded.
>

And can frozen objects be proxy targets, or no?  More generally, can a
proxy effectively override the behavior of a non-configurable, non-writable
property on the target?

    var target = Object.create(null, { foo: { writable: false,
configurable: false, value: 1 } });

    var proxy = new Proxy(target, {
      get(obj, name) { return name === "foo" ? 0 : obj[name]; }
    });

    console.log(target.foo); // 1
    console.log(proxy.foo); // 0

This this allowed?

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130119/4f2b7c65/attachment.html>


More information about the es-discuss mailing list