diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-07-06 14:49:09 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 16:43:49 +0800 |
commit | 6ea28f93b99dff66471a04d24632440d6f4099db (patch) | |
tree | 7f27c8dfd876c48f9340eba34f0e6fc1b9557574 /jsre | |
parent | 1208ac83d5a93214f23bf3f9236e29869ee62407 (diff) | |
download | dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.gz dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.zst dexon-6ea28f93b99dff66471a04d24632440d6f4099db.zip |
output BigNumbers objects in console as strings
Diffstat (limited to 'jsre')
-rw-r--r-- | jsre/pp_js.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/jsre/pp_js.go b/jsre/pp_js.go index 20821e4a1..735132bb7 100644 --- a/jsre/pp_js.go +++ b/jsre/pp_js.go @@ -97,7 +97,15 @@ var isMemberFunction = function(object, member) { } var isBigNumber = function (object) { - return typeof BigNumber !== 'undefined' && object instanceof BigNumber; + var result = typeof BigNumber !== 'undefined' && object instanceof BigNumber; + + if (!result) { + if(typeof(object) === "object") { + result = object.constructor.toString().indexOf("function BigNumber(") == 0; + } + } + + return result }; function prettyPrint(/* */) { |