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

Henrique Mendonca updated THRIFT-1214:
--------------------------------------

    Attachment: THRIFT-1214-args-constructor.patch

> JavaScript constructor does not accept object properties
> --------------------------------------------------------
>
>                 Key: THRIFT-1214
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1214
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler
>            Reporter: Pascal Bach
>            Assignee: Henrique Mendonca
>              Labels: javascript
>         Attachments: THRIFT-1214-args-constructor.patch
>
>
> When you give a constructor function a set of default parameters they don't 
> get assigned to the object correctly.
> The reason lies in the generated code:
> MyStruct = function(args) {
>       this.value = null;
>       if (args) {
>               if (!args.value) {
>                       this.value = args.value;
>               }
>       }
> };
> The check for  results !args.value causes that the value to be only set if it 
> is undefined.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to