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

Generated JavaScript code is missing a undefined check

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 0.10.0
    • None
    • JSON - Compiler
    • None
    • All

    • Patch Available

    Description

      The generated code of a *_result object can take an "args" argument to its "constructor". However, at least when using WebSocket, the *_result object is not passed an "args" parameter, hence args is undefined. However the code still makes an instanceof test on args, causing an exception to be thrown at least on newer browsers (Tested on Chrome 57 and Firefox 52). Adding an "args !== undefined &&" in front of this, makes everything work nicely again.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mh_newtec Martin Hejnfelt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: