commit | 4b3f1c31817b26385ec1a802dd4beffcf88c4caa | [log] [tgz] |
---|---|---|
author | Roger Meier <roger@apache.org> | 周六 1月 22 21:32:50 2011 +0000 |
committer | Roger Meier <roger@apache.org> | 周六 1月 22 21:32:50 2011 +0000 |
tree | 50ab2082697264e74e872cea8be3d7df0b83026a | |
parent | c7cd68eb86bfc4c07a12ee929fa2f7acdad909fc [diff] |
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; +}