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

Generated Y_types.js does not require() X_types.js when an include in the IDL file was used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.7
    • 0.9.1
    • Node.js - Compiler
    • Windows 7 x64

    Description

      Suppose you have the following thrift files:

      X.thrift
      struct Foo {
      	1: required i32 baz;
      }
      
      Y.thrift
      include "X.thrift"
      
      struct Bar {
      	1: required X.Foo foo;
      }
      

      And you compile this using:
      ./thrift-0.7.0 -strict -r --gen js:node Y.thrift

      Two files are created: "X_types.js" and "Y_types.js".
      Y_types has lines that look like:

      this.foo = new X_ttypes.Foo();
      

      However X_ttypes is never require()d
      The following line should be generated on top of the file:

      var X_ttypes = require('./X_types.js');
      

      Attachments

        1. add_type_info.patch
          0.9 kB
          Patrick Costello

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jorisw Joris van der Wel
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: