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

ASF GitHub Bot commented on THRIFT-3857:
----------------------------------------

GitHub user leaves4j opened a pull request:

    https://github.com/apache/thrift/pull/1034

    THRIFT-3857

    thrift js:node complier support an object as parameter not an instance of 
struct

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/leaves4j/thrift master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1034.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1034
    
----
commit bfbc0945649534cfa35b1e10fe327e64ee71905c
Author: jiangq <[email protected]>
Date:   2016-06-20T08:04:22Z

    change js generator for simple use in object params

commit b61a5e197311061f0c49c56825986da35a37adca
Author: jiangq <[email protected]>
Date:   2016-06-27T05:12:40Z

    format code style

commit bdb6ba7dd76343c3697951c8b72b202bcb52ea1d
Author: jiangq <[email protected]>
Date:   2016-06-27T14:32:36Z

    add the condition no params

commit c93b9e07aa4b273fef61eda28396ea8cdcef4901
Author: jiangq <[email protected]>
Date:   2016-06-27T14:35:27Z

    modify code style

----


> thrift js:node complier support an object as parameter not an instance of 
> struct
> --------------------------------------------------------------------------------
>
>                 Key: THRIFT-3857
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3857
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Node.js - Compiler
>    Affects Versions: 0.9.3, 1.0
>            Reporter: jiangq
>
> use the tutorial.thrift,code like:
> {code:javascript}
> let param = {
>   op: ttypes.Operation.DIVIDE,
>   num1: 1,
>   num2: 0
> }
> let work = new ttypes.Work(param);
> client.calculate(1, work)
>   .then(function(message) {
>       console.log('Whoa? You know how to divide by zero?');
>   })
>   .fail(function(err) {
>     console.log("InvalidOperation " + err);
>   });
> {code}
> can we support like these:
> {code:javascript}
> let work = {
>   op: ttypes.Operation.DIVIDE,
>   num1: 1,
>   num2: 0
> }
> client.calculate(1, work)
>   .then(function(message) {
>       console.log('Whoa? You know how to divide by zero?');
>   })
>   .fail(function(err) {
>     console.log("InvalidOperation " + err);
>   });
> {code}
> If we can support this feature will be very convenient, and I have read the 
> 't_js_generator.cc' file, find this feature is easy to support, can we add 
> the support for this feature?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to