Repository: thrift
Updated Branches:
  refs/heads/master 9be413fca -> 5d6378f61


fix js list<map> support


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/5d6378f6
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/5d6378f6
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/5d6378f6

Branch: refs/heads/master
Commit: 5d6378f61e2bed18e316f8f6d48de419a5848b12
Parents: 9be413f
Author: Liangliang He <[email protected]>
Authored: Tue Aug 19 18:25:37 2014 +0800
Committer: Roger Meier <[email protected]>
Committed: Sat Aug 23 22:22:46 2014 +0200

----------------------------------------------------------------------
 lib/js/src/thrift.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/5d6378f6/lib/js/src/thrift.js
----------------------------------------------------------------------
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 @@ Thrift.Protocol.prototype = {
      */
     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();
 

Reply via email to