callable objects ?
Tom Van Cutsem
tomvc.be at gmail.com
Thu Apr 19 07:55:51 PDT 2012
I still like the idea of distinguishing "private" from "unique" names,
where "private" = invisible via reflection & proxies and "unique" = visible
via reflection & proxies (cf. the thread David linked to).
As for how direct proxies might help: yes, I've previously proposed several
- One was to not allow proxies to trap private names, and always forward
private name access unconditionally, as mentioned by Brandon.
- The other was essentially Brendan's current proposal: if the trap is
missing, forward the private name access to the target without converting
it into a public object, except I also proposed factoring out private name
access into separate "getPrivate"/"setPrivate" traps. See:
2012/4/19 David Bruant <bruant.d at gmail.com>
> Le 19/04/2012 01:54, Brandon Benvie a écrit :
> (or you simply don't trap the access, which is the route for
>> [[prototype]], [[instanceof]], etc which now makes even more sense to me in
>> light of this)
> Not trapping seems like a valid option . The rationale for the .public
> counterpart in the private name proposal is that the proxy should not have
> access to the private name. However, if it doesn't (directly or
> indirectly), it can't do anything useful. Under these conditions, the trap
> might as well not been called.
>  https://mail.mozilla.org/**pipermail/es-discuss/2011-**
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss