aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-06-05 13:58:25 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-06-05 13:58:25 -0700
commit9d5ae1c6296df20ac27010503077cc22635c8ca2 (patch)
tree7458cd13fb758d99ebdeecf484f9e270bc21c088
parentf4cbf74f6f89f3c63530c5a6e94d24b7be8a09ff (diff)
Fixed handling of long values
-rw-r--r--src/node/src/common.js4
-rw-r--r--src/node/test/common_test.js3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/node/src/common.js b/src/node/src/common.js
index 7b543353eb..feaa859a4f 100644
--- a/src/node/src/common.js
+++ b/src/node/src/common.js
@@ -47,7 +47,9 @@ function deserializeCls(cls) {
* @return {cls} The resulting object
*/
return function deserialize(arg_buf) {
- return cls.decode(arg_buf).toRaw();
+ // Convert to a native object with binary fields as Buffers (first argument)
+ // and longs as strings (second argument)
+ return cls.decode(arg_buf).toRaw(false, true);
};
}
diff --git a/src/node/test/common_test.js b/src/node/test/common_test.js
index c336955963..08ba429ed7 100644
--- a/src/node/test/common_test.js
+++ b/src/node/test/common_test.js
@@ -39,7 +39,8 @@ var common = require('../src/common.js');
var ProtoBuf = require('protobufjs');
-var messages_proto = ProtoBuf.loadProtoFile(__dirname + '/test_messages.proto').build();
+var messages_proto = ProtoBuf.loadProtoFile(
+ __dirname + '/test_messages.proto').build();
describe('Proto message serialize and deserialize', function() {
var longSerialize = common.serializeCls(messages_proto.LongValues);