Type of property names, as seen by proxy traps
dherman at mozilla.com
Fri Jul 8 07:17:45 PDT 2011
> I'm not sure. I briefly checked the private names proposal <http://wiki.ecmascript.org/doku.php?id=harmony:private_name_objects> and I think the detailed interaction with proxies still has to be fleshed out.
Sure, I'll be happy to work with you on this.
> The proposal does mention: "All reflective operations that produce a property name, when reflecting on a private name, produce the name’s .public property instead of the name itself."
> Would the same hold for reflective operations that consume property names, such as handler traps?
No, they would require the private name object. The idea here is that you need a reference to the private name to get access to its property. So you can't do any proxy operations on a private property if you don't have the private name object. But the proxy traps do not automatically hand out that reference to a handler trap, in case the trap didn't already have a reference to it (which would constitute a leak). Instead, it hands them the corresponding public key. This way, *if* the trap has a reference to the private key, it can identify which private name is being accessed. Otherwise, the trap can't conclude anything more than "operation X was requested on *some* private name."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss