aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-11 22:24:35 +0800
committerobscuren <geffobscura@gmail.com>2014-08-11 22:24:35 +0800
commitc59d7a899b0ca121b3f982fa12405629109f1b47 (patch)
tree1859ac54e0f9948927287caeae863b730eb1fbd9 /ethereum
parentce8f24e57a3ba31d17c34db284bd3d9efa15e7d8 (diff)
downloaddexon-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.gz
dexon-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.zst
dexon-c59d7a899b0ca121b3f982fa12405629109f1b47.zip
Added open js option for repetitive tasks in ethereal
Diffstat (limited to 'ethereum')
-rw-r--r--ethereum/cmd.go8
-rw-r--r--ethereum/repl/repl.go12
-rw-r--r--ethereum/repl/repl_darwin.go4
3 files changed, 14 insertions, 10 deletions
diff --git a/ethereum/cmd.go b/ethereum/cmd.go
index ff2b8409c..5ddc91619 100644
--- a/ethereum/cmd.go
+++ b/ethereum/cmd.go
@@ -1,11 +1,13 @@
package main
import (
+ "io/ioutil"
+ "os"
+
"github.com/ethereum/eth-go"
"github.com/ethereum/go-ethereum/ethereum/repl"
+ "github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/utils"
- "io/ioutil"
- "os"
)
func InitJsConsole(ethereum *eth.Ethereum) {
@@ -25,7 +27,7 @@ func ExecJsFile(ethereum *eth.Ethereum, InputFile string) {
if err != nil {
logger.Fatalln(err)
}
- re := ethrepl.NewJSRE(ethereum)
+ re := javascript.NewJSRE(ethereum)
utils.RegisterInterrupt(func(os.Signal) {
re.Stop()
})
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)
}