Re: getter & setter for private objects

2009-11-02 Thread David-Sarah Hopwood
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 memo...@googlemail.com wrote: > 2009/11/2 Brendan Eich : > >> 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 solution

Re: getter & setter for private objects

2009-11-02 Thread Mike Samuel
2009/11/2 memo...@googlemail.com : > 2009/11/2 Brendan Eich : >>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 fo

Re: getter & setter for private objects

2009-11-02 Thread Brendan Eich
On Nov 2, 2009, at 3:05 PM, memo...@googlemail.com wrote: 2009/11/2 Brendan Eich : 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?

Re: getter & setter for private objects

2009-11-02 Thread memo...@googlemail.com
2009/11/2 Brendan Eich : >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 deoptimi

Re: getter & setter for private objects

2009-11-02 Thread Brendan Eich
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 e

Re: getter & setter for private objects

2009-11-02 Thread Mike Samuel
2009/11/2 Brendan Eich : > On Nov 2, 2009, at 10:47 AM, Mike Samuel wrote: > >> What do getters and setters do around with? >> >>  var flipFlop; >>  with ({ get test: function () { return (flipFlop = !flipFlop) ? >> 'flip' : 'flop'; } }) { >>    for (var i = 0; i < 10; ++i) { alert(test); } >>  } >

Re: getter & setter for private objects

2009-11-02 Thread Brendan Eich
On Nov 2, 2009, at 10:47 AM, Mike Samuel wrote: What do getters and setters do around with? var flipFlop; with ({ get test: function () { return (flipFlop = !flipFlop) ? 'flip' : 'flop'; } }) { for (var i = 0; i < 10; ++i) { alert(test); } } The with block invokes NewObjectEnvironmen

Re: getter & setter for private objects

2009-11-02 Thread Mike Samuel
What do getters and setters do around with? var flipFlop; with ({ get test: function () { return (flipFlop = !flipFlop) ? 'flip' : 'flop'; } }) { for (var i = 0; i < 10; ++i) { alert(test); } } The with block invokes NewObjectEnvironment with O being the binding object. But I'm uncl

Re: getter & setter for private objects

2009-11-02 Thread Brendan Eich
On Nov 2, 2009, at 2:34 AM, memo...@googlemail.com wrote: I like to use getter and setter on private objects (e.g. "var test"). That is very unclear; I'm guessing you mean getters and setters instead of plain variables in closures used to store private data. I didn't found any way to do

Re: Admin permissions

2009-11-02 Thread memo...@googlemail.com
2009/10/31 Vladimir : > well, why do I need some policy kit at all then? You need policykit to check if an user or a group is authorized to do a certain action. Also there should be a user-level policykit to prevent or to allow certain user programs doing certain actions. You maybe also want to lim

getter & setter for private objects

2009-11-02 Thread memo...@googlemail.com
I like to use getter and setter on private objects (e.g. "var test"). I didn't found any way to do this. I don't need sth. like Object.definePrivateProperty, because I only want to set getter and setter when I define the private object. Example proposal: var test; get test = function() { [..] }; s