2011/12/19 David Bruant <[email protected]>

> The public part is an unforgeable object (with the same .toString than
> the private name), so there is no ambiguity in a public->private map.
> You use the unforgeable public object as key in the map, so no collision
> issue due to string forgeability.
>

Again, the private names proposal is vague in this respect. I am under the
impression that it passes ToString(privateName.public) to the "get" trap.


> > In any case, by separating private name access out into separate
> > traps, if a proxy writer only implements get/set but not
> > getPrivate/setPrivate, then private name access would just be
> > forwarded to the proxy target by default, and there would be no need
> > for the proxy to maintain a public->private mapping for private names
> > it does not know or care about.
> If you define a getPrivate/setPrivate trap, does it have access to the
> private name directly or its public counterpart?


Only to the public counterpart, of course, otherwise we're back to square 1
and private names would leak.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to