News for hackers. Stuff that matters.
Re:Best Practices Exist For A Reason by damncabbage on Wednesday May 02, 2012 @11:23PM (#3922235)
It's the other way around. It was illegal in ECMAScript 3, which is what IE 8 and below (at the very least) implement:

  ObjectLiteral : 
      { } 
      { PropertyNameAndValueList } 

With ECMAScript 5 it is legal:

  ObjectLiteral : 
      { } 
      { PropertyNameAndValueList } 
      { PropertyNameAndValueList , } 

So before v5, the other browsers were incorrectly tolerating something that goes against the spec. It's only semi-recently that it's been "allowed" as a valid practice.

There are no comments on this comment yet.