Public/private namespaces in harmony classes proposal
brendan at mozilla.com
Thu Jul 7 23:20:50 PDT 2011
On Jul 7, 2011, at 11:15 PM, Brendan Eich wrote:
>> Suppose I have two objects, extensible instance X with private instance property 'foo', and extensible object Y upon which I have defined a property 'foo' using Object.defineProperty, setting writable=false. If a client of Y tries to extend if with a public 'foo' property, then this would fail (throwing a TypeError in strict mode code). Would it not be acceptable for the attempted assignment to the private property of X to fail in a similar fashion?
> No, that leaks the fact that there's a private-named object
er, "private property on the object".
More information about the es-discuss