You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/05 06:39:11 UTC

[jira] [Commented] (THRIFT-3857) thrift js:node complier support an object as parameter not an instance of struct

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

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

Github user leaves4j commented on the issue:

    https://github.com/apache/thrift/pull/1034
  
    What should I do with the fail checks


> 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)