Andreas Junghans schrieb:
> Hi,
>
> Am 29.05.2008 um 15:25 schrieb Derrell Lipman:
>
>   
>> On Thu, May 29, 2008 at 9:21 AM, Tobias Oetiker <[EMAIL PROTECTED]>  
>> wrote:
>> Experts,
>>
>> coming from a perl background, I like to write my lists like this
>>
>> var list = [
>>        key1: value1,
>>        key2: value2,
>> ];
>>
>> Note the final comma. The advantage of this is that I never have
>> missing commas when enhancing a list.
>>
>> Javascript seems to have nothing against this practice. The qooxdoo
>> treegenerator.py does not like it though. Is there anything that
>> can be done about this? Apart from not having that final comma?
>>
>> I would sure prefer this change, too.  I find myself tracking down  
>> these extra commas most times I have to do a build and I actually  
>> try to think about removing them when I'm coding.  The error  
>> messages generated because of these are recognizable by those of us  
>> who see them frequently, but they're difficult for newbies to  
>> comprehend.  Much better, I think, would be to just ignore the  
>> superfluous commas.
>>     
>
> IIRC, Internet Explorer doesn't like such trailing commas (at least  
> version 6) while Firefox is more tolerant.
>   
Right,

you can check this is you paste this into the URL field of IE and firefox:

javascript:alert([1,2,3,].length)

IE will report 4 while FF will report 3.

I would regard trailing commas as an error even if the language allows 
them, since the semantics are different among browsers.

Best Fabian

-- 
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Andreas Gauger, 
Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to