You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Patrick Costello (JIRA)" <ji...@apache.org> on 2013/05/31 03:50:20 UTC

[jira] [Updated] (THRIFT-1402) Generated Y_types.js does not require() X_types.js when an include in the IDL file was used

     [ https://issues.apache.org/jira/browse/THRIFT-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Costello updated THRIFT-1402:
-------------------------------------

    Attachment: add_type_info.patch

Hi Joris,

I'm not a normal contributor on the project, but my fix for this problem is attached (a git-patch). It is a relatively straight-forward change, perhaps someone can go-ahead and patch this in?

Best,
Patrick
                
> Generated Y_types.js does not require() X_types.js when an include in the IDL file was used
> -------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1402
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1402
>             Project: Thrift
>          Issue Type: Bug
>          Components: Node.js - Compiler
>    Affects Versions: 0.7
>         Environment: Windows 7 x64
>            Reporter: Joris van der Wel
>              Labels: include, nodejs
>         Attachments: add_type_info.patch
>
>
> Suppose you have the following thrift files:
> {code:title=X.thrift}
> struct Foo {
> 	1: required i32 baz;
> }
> {code}
> {code:title=Y.thrift}
> include "X.thrift"
> struct Bar {
> 	1: required X.Foo foo;
> }
> {code}
> 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:
> {code}
> this.foo = new X_ttypes.Foo();
> {code}
> However X_ttypes is never require()d
> The following line should be generated on top of the file:
> {code}
> var X_ttypes = require('./X_types.js');
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira