ES4 stable draft: object initializers

Brendan Eich brendan at mozilla.org
Wed Apr 30 11:00:41 PDT 2008


On Apr 17, 2008, at 5:15 PM, Erik Arvidsson wrote:

> 2008/4/17 Brendan Eich <brendan at mozilla.org>:
>> These are wanted by Ajax library hackers, jresig and shaver  
>> testify. Rather
>> than cut a long-standing proposal because a recent evolution of  
>> its *syntax*
>> (not its substance) led to something problematic, why not return  
>> to the
>> original syntax:
>
> Yes, this feature is indeed wanted.  The syntax is not that important.
>  There is also a desire to allow these to be defined on an existing
> object.


Can you say more about this last sentence? What existing objects  
would want meta-programming fixtures somehow added to their  
properties? I know, I'm to blame for __defineGetter__ and it has use- 
cases that o = {get x() {...}} can't satisfy, but a named getter is  
one thing -- a catch-all is different and scarier. Anyway, I'm  
interested in details about your use-cases.

/be




More information about the Es4-discuss mailing list