THRIFT-1043 Fix how the length of a map is calculated
Patch: Wade Simmons


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1062278 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/js/thrift.js b/lib/js/thrift.js
index 9b92658..fbdc809 100644
--- a/lib/js/thrift.js
+++ b/lib/js/thrift.js
@@ -713,5 +713,14 @@
    
 }
 
+Thrift.objectLength = function(obj) {
+  var length = 0;
+  for (k in obj) {
+    if (obj.hasOwnProperty(k)) {
+      length++;
+    }
+  }
+  return length;
+}