You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Roger Meier (JIRA)" <ji...@apache.org> on 2010/06/30 22:33:50 UTC

[jira] Issue Comment Edited: (THRIFT-807) JavaScript: Initialization of Base Types with 0 instead of null

    [ https://issues.apache.org/jira/browse/THRIFT-807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883797#action_12883797 ] 

Roger Meier edited comment on THRIFT-807 at 6/30/10 4:32 PM:
-------------------------------------------------------------

I absolutly agree, all types should be initialized to null.(or undefined?)

I propose to start extending ThriftTest.thrift with additional test cases as described above.

I'm ready to prepare a patch for that!
Are functions with all types as return value and one exception sufficient?
Or do we need an additional set with two exceptions?



      was (Author: roger.meier):
    I absolutly agree, all types should be initialized to null.(or undefined?)

I propose the start with extending ThriftTest.thrift with additional test cases as described above.

  
> JavaScript: Initialization of Base Types with 0 instead of null
> ---------------------------------------------------------------
>
>                 Key: THRIFT-807
>                 URL: https://issues.apache.org/jira/browse/THRIFT-807
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (JavaScript)
>    Affects Versions: 0.3
>            Reporter: Roger Meier
>         Attachments: THRIFT-807_initialize_with_null.patch
>
>
> I had a problem with the exception avaliable on the tutorial. 
> i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch),
> It couldn't be thrown because initialization of numeric base types is done with 0 instead of null and the checks do compare against null.
> This was not visible with the Tests provided with first patch for JavaScript bindings above, the ThriftTest.thrift definition does not have a combination of a base type return value and an exception.
> I've made a patch that initializes the base types I16,I32, I64 and DOUBLE with null. This could probably solve other issues as well
> Regards
> Roger

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.