From 73e0b492728761c5aee4b5013a7c9cc0e4d6f2cf Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Wed, 20 Jul 2016 17:11:04 +0300 Subject: fix debug.dump --- js/debug.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/debug.js') 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); } } -- cgit v1.2.3