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

Javascript struct constants declared in the same file as their struct definition will cause an error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.7
    • 0.8
    • JavaScript - Compiler
    • None
    • Patch Available

    Description

      Constants are written out to the generated javascript file before structs are, so if you declare a constant that is of a type declared in the same file, you'll get an error telling you '<member name> is not a property of undefined' or something similar.

      I fixed this by swapping the order in which structs and constants are written out in t_generator, and it doesn't seem to have broken anything in java, javascript, cocoa, php or c++. However, it could probably use a little testing in other languages.

      Attachments

        1. thrift-1432.patch
          0.8 kB
          Mike Riley

        Activity

          People

            yelirekim Mike Riley
            yelirekim Mike Riley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: