From c54d123b31cc66f81de815493ab83f019190f241 Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Wed, 22 Apr 2015 02:31:59 +0200 Subject: setTimeout and sendAsync implemented added and eval queue for serializing JSRE vm execution --- cmd/geth/js.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd/geth') diff --git a/cmd/geth/js.go b/cmd/geth/js.go index a545de1d0..d8c26eb2f 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -103,6 +103,7 @@ func (js *jsre) apiBindings() { t, _ := js.re.Get("jeth") jethObj := t.Object() jethObj.Set("send", jeth.Send) + jethObj.Set("sendAsync", jeth.Send) err := js.re.Compile("bignumber.js", re.BigNumber_JS) if err != nil { @@ -172,8 +173,10 @@ func (self *jsre) UnlockAccount(addr []byte) bool { func (self *jsre) exec(filename string) error { if err := self.re.Exec(filename); err != nil { + self.re.Stop(false) return fmt.Errorf("Javascript Error: %v", err) } + self.re.Stop(true) return nil } @@ -201,6 +204,7 @@ func (self *jsre) interactive() { if self.atexit != nil { self.atexit() } + self.re.Stop(false) } func (self *jsre) withHistory(op func(*os.File)) { -- cgit