It doesn't just break in IE : it's a violation of the JS standard, which doesn't allow for trailing commas.

- Eugene

On 9/21/10 11:51 AM, Ilya Maykov (JIRA) wrote:
(JavaScript compiler) Const structs, maps, sets, and lists generate a trailing 
comma
------------------------------------------------------------------------------------

                  Key: THRIFT-911
                  URL: https://issues.apache.org/jira/browse/THRIFT-911
              Project: Thrift
           Issue Type: Bug
           Components: JavaScript - Compiler
     Affects Versions: 0.4
             Reporter: Ilya Maykov


The JavaScript compiler generates a trailing comma when compiling non-primitive 
constants. For example, this thrift code:

namespace js Toy
const map<byte,string>  TOY_MAP = {
   1 : "ONE",
   2 : "TWO",
   3 : "THREE"
}

generates this JavaScript code:

Toy.TOY_MAP = {1 : 'ONE',
2 : 'TWO',
3 : 'THREE',
}

According to Google's Closure compiler, this will breaks in some versions of 
IE. We have a patch available and would like to submit it to trunk.
The bug is present in at least 0.4.0 and in trunk as of revision r999487.

Reply via email to