good morning!!!!

Skip to content
Snippets Groups Projects
Commit 6763d28a authored by Viktor Trón's avatar Viktor Trón
Browse files

repl.Stop() to only if running, fixes panic after js> exit followed by interrupt

parent bf57e960
Branches
Tags
No related merge requests found
......@@ -23,6 +23,8 @@ type JSRepl struct {
prompt string
history *os.File
running bool
}
func NewJSRepl(ethereum *eth.Ethereum) *JSRepl {
......@@ -35,6 +37,8 @@ func NewJSRepl(ethereum *eth.Ethereum) *JSRepl {
}
func (self *JSRepl) Start() {
if !self.running {
self.running = true
logger.Infoln("init JS Console")
reader := bufio.NewReader(self.history)
for {
......@@ -50,12 +54,16 @@ func (self *JSRepl) Start() {
}
self.read()
}
}
func (self *JSRepl) Stop() {
if self.running {
self.running = false
self.re.Stop()
logger.Infoln("exit JS Console")
self.history.Close()
}
}
func (self *JSRepl) parseInput(code string) {
defer func() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment