From c59d7a899b0ca121b3f982fa12405629109f1b47 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 11 Aug 2014 16:24:35 +0200 Subject: Added open js option for repetitive tasks in ethereal --- ethereum/repl/repl.go | 12 +++++++----- ethereum/repl/repl_darwin.go | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ethereum/repl') diff --git a/ethereum/repl/repl.go b/ethereum/repl/repl.go index 92d4ad86a..d08feb7b4 100644 --- a/ethereum/repl/repl.go +++ b/ethereum/repl/repl.go @@ -3,12 +3,14 @@ package ethrepl import ( "bufio" "fmt" - "github.com/ethereum/eth-go" - "github.com/ethereum/eth-go/ethlog" - "github.com/ethereum/eth-go/ethutil" "io" "os" "path" + + "github.com/ethereum/eth-go" + "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/eth-go/ethutil" + "github.com/ethereum/go-ethereum/javascript" ) var logger = ethlog.NewLogger("REPL") @@ -19,7 +21,7 @@ type Repl interface { } type JSRepl struct { - re *JSRE + re *javascript.JSRE prompt string @@ -34,7 +36,7 @@ func NewJSRepl(ethereum *eth.Ethereum) *JSRepl { panic(err) } - return &JSRepl{re: NewJSRE(ethereum), prompt: "> ", history: hist} + return &JSRepl{re: javascript.NewJSRE(ethereum), prompt: "> ", history: hist} } func (self *JSRepl) Start() { diff --git a/ethereum/repl/repl_darwin.go b/ethereum/repl/repl_darwin.go index 3a91b0d44..4c07280f7 100644 --- a/ethereum/repl/repl_darwin.go +++ b/ethereum/repl/repl_darwin.go @@ -115,8 +115,8 @@ L: } func (self *JSRepl) PrintValue(v interface{}) { - method, _ := self.re.vm.Get("prettyPrint") - v, err := self.re.vm.ToValue(v) + method, _ := self.re.Vm.Get("prettyPrint") + v, err := self.re.Vm.ToValue(v) if err == nil { method.Call(method, v) } -- cgit