aboutsummaryrefslogtreecommitdiffstats
path: root/jsre
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-04-02 08:13:34 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-04-02 17:02:39 +0800
commitf960fc066e2daa27658e61e2b5da381c31bfff15 (patch)
tree443f191cc03ff8fa84b0672bb55e3d24509c113f /jsre
parentbb3ae3026edec431c59299271f1af682e8dbb938 (diff)
downloaddexon-f960fc066e2daa27658e61e2b5da381c31bfff15.tar
dexon-f960fc066e2daa27658e61e2b5da381c31bfff15.tar.gz
dexon-f960fc066e2daa27658e61e2b5da381c31bfff15.tar.bz2
dexon-f960fc066e2daa27658e61e2b5da381c31bfff15.tar.lz
dexon-f960fc066e2daa27658e61e2b5da381c31bfff15.tar.xz
dexon-f960fc066e2daa27658e61e2b5da381c31bfff15.tar.zst
dexon-f960fc066e2daa27658e61e2b5da381c31bfff15.zip
fixed printing BigNumbers
Diffstat (limited to 'jsre')
-rw-r--r--jsre/pp_js.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/jsre/pp_js.go b/jsre/pp_js.go
index 78509fc0b..0b22afe6d 100644
--- a/jsre/pp_js.go
+++ b/jsre/pp_js.go
@@ -25,6 +25,8 @@ function pp(object, indent) {
str += " ]";
} else if (object instanceof Error) {
str += "\033[31m" + "Error";
+ } else if (isBigNumber(object)) {
+ str += "\033[32m'" + object.toString(10) + "'";
} else if(typeof(object) === "object") {
str += "{\n";
indent += " ";
@@ -61,6 +63,11 @@ function pp(object, indent) {
return str;
}
+var isBigNumber = function (object) {
+ return typeof BigNumber !== 'undefined' && object instanceof BigNumber;
+};
+
+
function prettyPrint(/* */) {
var args = arguments;
var ret = "";