Strict mode recap

Brendan Eich brendan at mozilla.org
Fri Apr 11 12:43:36 PDT 2008


On Apr 11, 2008, at 10:22 AM, Lars Hansen wrote:

> (It _is_ an indication that the syntax used in
> the object initializers is not fully general, though, since it only
> allows simple identifiers in the namespace position.  Sigh.)

I've argued that JS's literal property identifiers in object  
initialisers, instead of mandatory quoted strings for literal names  
and evaluated expressions for runtime naming, is a virtue, pace  
Python. It certainly reduces the quote burden compared to JSON or  
Python. It allows readers and compilers to make static judgments  
about what names are bound in the object created for the initialiser.  
Anyway, it's an old decision, hard to change now.

I'm mailing mainly to ask whether this restriction is something  
considered harmful in ES4 with namespaces, or for any other reason. I  
think Jon and I have agreed in the past on namespaces being constant,  
but argument has evolved since then.

My reason for agreeing with Jon then was that readers, never mind  
compilers, otherwise can have a hard time figuring out the meaning of  
names. This is always hard with globals, less so with outer names in  
closures, and no picnic with property initialisers if you add  
computed namespaces to them.

I don't have a stronger reason than favoring comprehension and easing  
implementation, though. The second is less important than the first,  
but we consider efficiency too.

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080411/9dc97bc4/attachment-0002.html 


More information about the Es4-discuss mailing list