getter & setter for private objects

Mike Samuel mikesamuel at gmail.com
Mon Nov 2 15:31:21 PST 2009


2009/11/2 memolus at googlemail.com <memolus at googlemail.com>:
> 2009/11/2 Brendan Eich <brendan at mozilla.com>:
>>Defining accessors on an activation object is nasty,
>>If you want private getters and setters, you can put them in an object denoted by a private var:
> So you prefer ugly solutions, because the others are nasty?
>
>> The upshot for memolus is that with is already a deoptimizer that introduces
>> non-lexical names onto the scope chain. These can be gettters and setters
>> and have arbitrary effects. My point remains that adding getters and setters
>> to activations, which are modeled lexically in the absence of eval, in
>> strict mode in ES5, and under other such conditions, is a non-starter.
>
> I didn't get how to use "with" in order to use private objects
> (non-lexical names onto the scope chain). Just ignore my example if it
> tries to add getter and setter to already activated objects. You don't
> have to implement it this way.

What is it that you want?  Some use cases would help focus the discussion.


> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list