From 6ea28f93b99dff66471a04d24632440d6f4099db Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Mon, 6 Jul 2015 08:49:09 +0200 Subject: [PATCH] output BigNumbers objects in console as strings --- jsre/pp_js.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jsre/pp_js.go b/jsre/pp_js.go index 20821e4a1b..735132bb74 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(/* */) {