Ducks, Rabbits, and Privacy

Brendan Eich brendan at mozilla.com
Thu Jan 24 10:45:07 PST 2013


Benoit Marchant wrote:
> Isn't it possible internally to allow a property access only by "this" ?

No. For one thing, the design has to include class-private instance 
variables, not instance-private, so you need other.foo as well as 
this.foo (consider private x and y for Point2D add method).

Also, again, we're not enforcing privacy at the descriptor level with 
some kind of access control monitor, rather through "names" (whether 
symbols or weakmaps) as capabilities. Avoids confused deputy attacks.

/be


More information about the es-discuss mailing list