fix js list<map> support
diff --git a/lib/js/src/thrift.js b/lib/js/src/thrift.js
index 6cab4fd..7a18206 100644
--- a/lib/js/src/thrift.js
+++ b/lib/js/src/thrift.js
@@ -1153,9 +1153,15 @@
*/
readMapBegin: function() {
var map = this.rstack.pop();
+ var first = map.shift();
+ if (first instanceof Array) {
+ this.rstack.push(map);
+ map = first;
+ first = map.shift();
+ }
var r = {};
- r.ktype = Thrift.Protocol.RType[map.shift()];
+ r.ktype = Thrift.Protocol.RType[first];
r.vtype = Thrift.Protocol.RType[map.shift()];
r.size = map.shift();