aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-07-06 14:49:09 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-07 16:43:49 +0800
commit6ea28f93b99dff66471a04d24632440d6f4099db (patch)
tree7f27c8dfd876c48f9340eba34f0e6fc1b9557574
parent1208ac83d5a93214f23bf3f9236e29869ee62407 (diff)
downloaddexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar
dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.gz
dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.bz2
dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.lz
dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.xz
dexon-6ea28f93b99dff66471a04d24632440d6f4099db.tar.zst
dexon-6ea28f93b99dff66471a04d24632440d6f4099db.zip
output BigNumbers objects in console as strings
-rw-r--r--jsre/pp_js.go10
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(/* */) {