ES4 draft: Object

Brendan Eich brendan at mozilla.org
Thu Mar 6 18:04:18 PST 2008


On Mar 6, 2008, at 5:57 PM, Garrett Smith wrote:

> On Wed, Mar 5, 2008 at 7:19 PM, Brendan Eich <brendan at mozilla.org>  
> wrote:
>> Hixie argued strongly on IRC today for something that does not
>
>>  So, rather than add an ugly "dontenum" keyword that would be seldom
>>  used, the group preferred a built-in method. But this may have  
>> been a
>>  minor mistake. For those interested, here's the full rationale as I
>>  remember it:
>>
>
> obj = {dontenum length: 10} );
>
> vs.
>
> obj = {length: 10};
> obj.propertyIsEnumerable("length", false);
>
> Which is more ugly?

Except the known use-case, setting DontEnum properties on standard  
prototypes (as the Prototype Ajax library did and still does AFAIK),  
does not use object initialisers.

Even so, "dontenum" as a compound word starting with a contraction  
whose apostrophe is elided is no beauty contest winner. But before  
arguing over those aesthetics, we need a more compelling use-case.

Remember that fixtures declared in classes are not enumerable, which  
is the right default for all the "native" (built-in is better, since  
these can be and are increasingly self-hosted) objects' properties.

/be




More information about the Es4-discuss mailing list