aboutsummaryrefslogtreecommitdiff
path: root/js/debug.js
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2016-07-20 17:11:04 +0300
committerNikolai Vavilov <vvnicholas@gmail.com>2016-07-20 17:11:04 +0300
commit73e0b492728761c5aee4b5013a7c9cc0e4d6f2cf (patch)
tree31d03f84ea4b863cc08361482d0b90bf55a60128 /js/debug.js
parente4b129f304a28db71a538af35afae0af91b02129 (diff)
downloadprotobuf-73e0b492728761c5aee4b5013a7c9cc0e4d6f2cf.tar.gz
protobuf-73e0b492728761c5aee4b5013a7c9cc0e4d6f2cf.tar.bz2
protobuf-73e0b492728761c5aee4b5013a7c9cc0e4d6f2cf.zip
fix debug.dump
Diffstat (limited to 'js/debug.js')
-rw-r--r--js/debug.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/debug.js b/js/debug.js
index 3701a095..3c1ada02 100644
--- a/js/debug.js
+++ b/js/debug.js
@@ -94,8 +94,10 @@ jspb.debug.dump_ = function(thing) {
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);
}
}