[ https://issues.apache.org/jira/browse/THRIFT-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15962013#comment-15962013 ]
ASF GitHub Bot commented on THRIFT-2939: ---------------------------------------- GitHub user jeking3 opened a pull request: https://github.com/apache/thrift/pull/1249 THRIFT-2939: reviving pr #353 to see if it still works with crosstest You can merge this pull request into a Git repository by running: $ git pull https://github.com/jeking3/thrift THRIFT-2939-revive Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/1249.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 #1249 ---- commit 3ea275d736e3562dc8dcb53da8ff19ecf9ef2db2 Author: James E. King, III <jim.k...@simplivity.com> Date: 2017-04-09T02:21:35Z THRIFT-2939: reviving pr #353 to see if it still works with crosstest ---- > JavaScript generated code for Node and browser is different > ----------------------------------------------------------- > > Key: THRIFT-2939 > URL: https://issues.apache.org/jira/browse/THRIFT-2939 > Project: Thrift > Issue Type: Improvement > Components: JavaScript - Compiler, JavaScript - Library > Affects Versions: 0.9.2 > Reporter: Radoslaw Gruchalski > Labels: javascript, patch > > The generated code for regular JS differs from NodeJS code. NodeJS uses > direct return values from {{read<Type>()}} while regular JS code expects a > value from {{read<Type>()}} to be an object with {{.value}} property. > This makes it impossible to share generated code between browser JS and > NodeJS. The fix is rather simple: > - do not append {{.value}} in generated code while accessing values read from > protocol / transport > - do not return an object with the value property from {{read}}, return > result read > I am not sure why such difference. Both environment implementations take an > input, which is a protocol, and execute the same read methods. There is no > need to have an additional complexity in regular JS. -- This message was sent by Atlassian JIRA (v6.3.15#6346)