[
https://issues.apache.org/jira/browse/THRIFT-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14945059#comment-14945059
]
Randy Abernethy commented on THRIFT-2994:
-----------------------------------------
Regarding the tests, it would be great to have all tests pass after every patch
but as long as no additional tests fail after the patch we can commit it on the
merits of the patch. There are failing node tests in the current master that
are not associated with your patch.
I'm reviewing 379
(https://patch-diff.githubusercontent.com/raw/apache/thrift/pull/379.patch).
The first hunk of the patch I see:{code}
@@ -40,6 +40,8 @@ module.exports = TJSONProtocol;
*/
function TJSONProtocol(trans) {
this.trans = trans;
+ this.tstack = [];
+ this.tpos = [];
};{code}
Conflicts with the master which contains: {code}
function TJSONProtocol(trans) {
this.tstack = [];
this.tpos = [];
this.trans = trans;
}; {code}
Am I not grabbing the right patch?
> Node.js TJSONProtocol cannot be used for object serialization.
> --------------------------------------------------------------
>
> Key: THRIFT-2994
> URL: https://issues.apache.org/jira/browse/THRIFT-2994
> Project: Thrift
> Issue Type: Bug
> Components: Node.js - Library
> Reporter: Jan Brauer
> Assignee: Randy Abernethy
>
> Consider the following code using the Thrift example types.
> {code:title=serialize.js|borderStyle=solid}
> var thrift = require('thrift');
> var test_types = require('gen-nodejs/ThriftTest_types.js');
> var bonk = new test_types.Bonk({message: "message", type: 6})
> var t_out = new thrift.TBufferedTransport();
> var p_out = new thrift.TJSONProtocol(t_out);
> bonk.write(p_out);
> var out
> t_out.flush(function (b) { out = b;});
> console.log(out)
> {code}
> My expectation would be for {{out}} to contain the serialized {{Bonk}} struct.
> But due to
> [TJSONProtocol|https://github.com/apache/thrift/blob/master/lib/nodejs/lib/thrift/protocol.js#L1287]
> only writing to the underlying transport in {{writeMessageEnd}} the above
> code does not work.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)