You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Mike Riley (Created) (JIRA)" <ji...@apache.org> on 2011/11/19 13:04:51 UTC

[jira] [Created] (THRIFT-1432) Javascript struct constants declared in the same file as their struct definition will cause an error

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

                 Key: THRIFT-1432
                 URL: https://issues.apache.org/jira/browse/THRIFT-1432
             Project: Thrift
          Issue Type: Bug
          Components: JavaScript - Compiler
    Affects Versions: 0.7
            Reporter: Mike Riley
            Priority: Minor


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1432) Javascript struct constants declared in the same file as their struct definition will cause an error

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13154199#comment-13154199 ] 

Hudson commented on THRIFT-1432:
--------------------------------

Integrated in Thrift #339 (See [https://builds.apache.org/job/Thrift/339/])
    Thrift-1432: Javascript struct constants declared in the same file as their struct definition will cause an error
Client: js
Patch: Mike Riley

Flips print out of constants and structs within the generator to allow for use of constants within the structs.

                
> Javascript struct constants declared in the same file as their struct definition will cause an error
> ----------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1432
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1432
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler
>    Affects Versions: 0.7
>            Reporter: Mike Riley
>            Assignee: Mike Riley
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: thrift-1432.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1432) Javascript struct constants declared in the same file as their struct definition will cause an error

Posted by "Mike Riley (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Riley updated THRIFT-1432:
-------------------------------

    Attachment: thrift-1432.patch
    
> Javascript struct constants declared in the same file as their struct definition will cause an error
> ----------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1432
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1432
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler
>    Affects Versions: 0.7
>            Reporter: Mike Riley
>            Priority: Minor
>         Attachments: thrift-1432.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (THRIFT-1432) Javascript struct constants declared in the same file as their struct definition will cause an error

Posted by "Jake Farrell (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell closed THRIFT-1432.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.8
         Assignee: Mike Riley

Committed, thanks for the patch
                
> Javascript struct constants declared in the same file as their struct definition will cause an error
> ----------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1432
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1432
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler
>    Affects Versions: 0.7
>            Reporter: Mike Riley
>            Assignee: Mike Riley
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: thrift-1432.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira