Merge pull request #633 from debris/prototype_functions
printing object prototype functions in geth console
This commit is contained in:
commit
97d6b0bab8
|
@ -30,8 +30,8 @@ function pp(object, indent) {
|
|||
} else if(typeof(object) === "object") {
|
||||
str += "{\n";
|
||||
indent += " ";
|
||||
var last = Object.getOwnPropertyNames(object).pop()
|
||||
Object.getOwnPropertyNames(object).forEach(function (k) {
|
||||
var last = getFields(object).pop()
|
||||
getFields(object).forEach(function (k) {
|
||||
str += indent + k + ": ";
|
||||
try {
|
||||
str += pp(object[k], indent);
|
||||
|
@ -63,11 +63,18 @@ function pp(object, indent) {
|
|||
return str;
|
||||
}
|
||||
|
||||
var getFields = function (object) {
|
||||
var result = Object.getOwnPropertyNames(object);
|
||||
if (object.constructor && object.constructor.prototype) {
|
||||
result = result.concat(Object.getOwnPropertyNames(object.constructor.prototype));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
var isBigNumber = function (object) {
|
||||
return typeof BigNumber !== 'undefined' && object instanceof BigNumber;
|
||||
};
|
||||
|
||||
|
||||
function prettyPrint(/* */) {
|
||||
var args = arguments;
|
||||
var ret = "";
|
||||
|
|
Loading…
Reference in New Issue