Controlling DontEnum (was: ES4 draft: Object)

Lars Hansen lhansen at adobe.com
Thu Mar 13 14:07:29 PDT 2008


> -----Original Message-----
> From: Neil Mix [mailto:nmix at pandora.com] 
> Sent: 13. mars 2008 14:47
> To: Lars Hansen
> Cc: es4-discuss at mozilla.org
> Subject: Re: Controlling DontEnum (was: ES4 draft: Object)
> 
> On Mar 13, 2008, at 11:47 AM, Lars Hansen wrote:
> 
> >  function __createProperty__(name:EnumerableId,
> >                              dontEnum:boolean=false,
> >                              dontDelete:boolean=false,
> >                              readOnly:boolean=false): void
> 
> 
> I like where this is going.  May I (in addition to Kris's 
> suggestion for adding a value parameter) kindly nit on the 
> parameter names?
> 
> function __createProperty__(name:EnumerableId,
>                              value:*,
>                              enumerable:boolean=true,
>                              removable:boolean=true,
>                              writable:boolean=true): void
> 
> Or some reasonable variant therein?  I have no strong 
> opinions on the form the parameters eventually take, but 
> trying to parse what dontenum=false means tends to give me 
> headaches. ;)

Well, it had to come up at some point ;)

I suspect what you're proposing is the better UI.  Obviously JS1/ES3
shows a bias for enumerable, removable, writable properties -- the
attribute bits flag exceptions from the general rule.  The more general
design has attribute bits that simply control those property aspects,
and the less biased names feel like an improvement.

Brendan, opinions?

--lars



More information about the Es4-discuss mailing list