From 563c035eb57a0507979a84f3dd22411be2a4cad1 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 20 May 2014 19:28:48 +0200 Subject: Refactored some of the functions --- ethereum/repl_darwin.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ethereum/repl_darwin.go') diff --git a/ethereum/repl_darwin.go b/ethereum/repl_darwin.go index cf6e24e18..1b98c2150 100644 --- a/ethereum/repl_darwin.go +++ b/ethereum/repl_darwin.go @@ -8,7 +8,6 @@ package main import "C" import ( - "github.com/obscuren/otto" "strings" "unsafe" ) @@ -87,7 +86,10 @@ L: } } -func (self *JSRepl) PrintValue(value otto.Value) { +func (self *JSRepl) PrintValue(v interface{}) { method, _ := self.re.vm.Get("prettyPrint") - method.Call(method, value) + v, err := self.re.vm.ToValue(v) + if err == nil { + method.Call(method, v) + } } -- cgit