commit | 73e0b492728761c5aee4b5013a7c9cc0e4d6f2cf | [log] [tgz] |
---|---|---|
author | Nikolai Vavilov <vvnicholas@gmail.com> | Wed Jul 20 17:11:04 2016 +0300 |
committer | Nikolai Vavilov <vvnicholas@gmail.com> | Wed Jul 20 17:11:04 2016 +0300 |
tree | 31d03f84ea4b863cc08361482d0b90bf55a60128 | |
parent | e4b129f304a28db71a538af35afae0af91b02129 [diff] [blame] |
fix debug.dump
diff --git a/js/debug.js b/js/debug.js index 3701a09..3c1ada0 100644 --- a/js/debug.js +++ b/js/debug.js
@@ -94,8 +94,10 @@ var match = /^get([A-Z]\w*)/.exec(name); if (match && name != 'getExtension' && name != 'getJsPbMessageId') { - var val = thing[name](); - if (val != null) { + var has = 'has' + match[1]; + if (!thing[has] || thing[has]()) + { + var val = thing[name](); object[jspb.debug.formatFieldName_(match[1])] = jspb.debug.dump_(val); } }