Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-911

(JavaScript compiler) Const structs, maps, sets, and lists generate a trailing comma

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4
    • 0.5
    • JavaScript - Compiler
    • None
    • Patch Available

    Description

      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.

      Attachments

        1. THRIFT-911.patch
          2 kB
          Ilya Maykov

        Activity

          People

            tjake T Jake Luciani
            ilyam Ilya Maykov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: