diff options
Diffstat (limited to 'jsre/pp_js.go')
-rw-r--r-- | jsre/pp_js.go | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/jsre/pp_js.go b/jsre/pp_js.go index 20821e4a1..d29e21cfa 100644 --- a/jsre/pp_js.go +++ b/jsre/pp_js.go @@ -1,3 +1,19 @@ +// Copyright 2014 The go-ethereum Authors +// This file is part of go-ethereum. +// +// go-ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// go-ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. + package jsre const pp_js = ` @@ -97,7 +113,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(/* */) { |