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

Thrift Generated Code Causes Global Variable Leaks

    XMLWordPrintableJSON

Details

    Description

      When compiling for NodeJS, the compiler creates globally scoped variables which is considered a bad practice as it can create unintended consequences. It also causes many testing frameworks to fail.

      the output looks something like this:

      User = module.exports.User = function(args) {
      

      when it should be

      var User = module.exports.User = function(args) {
      

      Attachments

        1. fix_globals.js
          1 kB
          Chris Thompson
        2. 0001-THRIFT-1840-fix-for-global-variable-leak.patch
          1 kB
          Russell Bradberry

        Issue Links

          Activity

            People

              Unassigned Unassigned
              devdazed Russell Bradberry
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: