diff options
-rw-r--r-- | src/node/src/common.js | 4 | ||||
-rw-r--r-- | src/node/test/common_test.js | 3 |
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); |