Commit 73e0b492 authored by Nikolai Vavilov's avatar Nikolai Vavilov

fix debug.dump

parent e4b129f3
...@@ -94,8 +94,10 @@ jspb.debug.dump_ = function(thing) { ...@@ -94,8 +94,10 @@ jspb.debug.dump_ = function(thing) {
var match = /^get([A-Z]\w*)/.exec(name); var match = /^get([A-Z]\w*)/.exec(name);
if (match && name != 'getExtension' && if (match && name != 'getExtension' &&
name != 'getJsPbMessageId') { name != 'getJsPbMessageId') {
var val = thing[name](); var has = 'has' + match[1];
if (val != null) { if (!thing[has] || thing[has]())
{
var val = thing[name]();
object[jspb.debug.formatFieldName_(match[1])] = jspb.debug.dump_(val); object[jspb.debug.formatFieldName_(match[1])] = jspb.debug.dump_(val);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment