by ralesk · 14y ago · 0 comments
It is an IE bug that causes it to break. One of the many ways they do not follow the spec.
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.Not to mention, IE8 was released half a year before ES5 (according to a quick check on Wikipedia). So yes, pre-ES5 I'd say it's a normal thing to do not to allow trailing commas.