aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-06-15 22:33:36 +0800
committerBas van Kervel <bas@ethdev.com>2015-06-15 22:33:36 +0800
commitf06f220c7c8de5fe4a08cf7d6d9531a0a564ee12 (patch)
tree8c3be7cea606d914d77da0743cf6565c5ebf410d /cmd
parent2a0528303fb18dcc6799405d62a3a6f19da20b4a (diff)
downloaddexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.tar
dexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.tar.gz
dexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.tar.bz2
dexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.tar.lz
dexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.tar.xz
dexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.tar.zst
dexon-f06f220c7c8de5fe4a08cf7d6d9531a0a564ee12.zip
added printing support for objects
Diffstat (limited to 'cmd')
-rw-r--r--cmd/console/js.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/console/js.go b/cmd/console/js.go
index bda58be4d..15ea9bedd 100644
--- a/cmd/console/js.go
+++ b/cmd/console/js.go
@@ -332,11 +332,13 @@ func (self *jsre) welcome(ipcpath string) {
func (self *jsre) batch(args cli.Args) {
statement := strings.Join(args, " ")
-
val, err := self.re.Run(statement)
if err != nil {
fmt.Printf("error: %v", err)
+ } else if val.IsDefined() && val.IsObject() {
+ obj, _ := self.re.Get("ret_result")
+ fmt.Printf("%v", obj)
} else if val.IsDefined() {
fmt.Printf("%v", val)
}
@@ -346,7 +348,6 @@ func (self *jsre) batch(args cli.Args) {
}
self.re.Stop(false)
-
}
func (self *jsre) interactive(ipcpath string) {