Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.9.2
-
None
-
Patch Available
Description
I am working on a solution which uses Thrift directly, without embedded RPC framework, it's sending messages via UDP. Currently being integrated into Chrome Extension and I found a bug when doing the following:
var transport = new Thrift.TWebSocketTransport("http://dummy"); var protocol = new Thrift.Protocol( transport ); digest.write( protocol );
The error is:
Cannot read property 'push' of undefined.
The reason for this behaviour is:
digest.write calls protocol.writeStructBegin which uses this.tpos.push(this.tstack.length) in https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L778 but tpos and tstack aren't defined unless writeMessageBegin is called in https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L751.
Expected behaviour:
tstack and tpos should be defined in the Protocol "constructor", here: https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L687.