print nonenumerable properties of object in geth console

pull/625/head
Marek Kotewicz 10 years ago
parent b8124ec791
commit bb3ae3026e
  1. 16
      jsre/pp_js.go

@ -23,18 +23,26 @@ function pp(object, indent) {
}
}
str += " ]";
} else if (object instanceof Error) {
str += "\033[31m" + "Error";
} else if(typeof(object) === "object") {
str += "{\n";
indent += " ";
var last = Object.keys(object).pop()
for(var k in object) {
str += indent + k + ": " + pp(object[k], indent);
var last = Object.getOwnPropertyNames(object).pop()
Object.getOwnPropertyNames(object).forEach(function (k) {
str += indent + k + ": ";
try {
str += pp(object[k], indent);
} catch (e) {
str += pp(e, indent);
}
if(k !== last) {
str += ",";
}
str += "\n";
}
});
str += indent.substr(2, indent.length) + "}";
} else if(typeof(object) === "string") {
str += "\033[32m'" + object + "'";

Loading…
Cancel
Save