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


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