diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-08 19:39:33 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-08 19:39:33 +0800 |
commit | 15bfae52d253258829c10b14b43b02c73e3f7d04 (patch) | |
tree | 201e4e8b7ab545594bd1ef3dfeb75faba80a2e11 /jsre/jsre.go | |
parent | 03473d48c1436380b9248e65803ba56e1c584663 (diff) | |
parent | f6e71b5749a52df7be26abb2ae0f3731aaaaca08 (diff) | |
download | go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.tar go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.tar.gz go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.tar.bz2 go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.tar.lz go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.tar.xz go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.tar.zst go-tangerine-15bfae52d253258829c10b14b43b02c73e3f7d04.zip |
Merge pull request #876 from obscuren/jsre_fixes
jsre, cmd/geth: updated web3.js and altered settimeout
Diffstat (limited to 'jsre/jsre.go')
-rw-r--r-- | jsre/jsre.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jsre/jsre.go b/jsre/jsre.go index 7549b5e1e..6a7cb1b83 100644 --- a/jsre/jsre.go +++ b/jsre/jsre.go @@ -143,6 +143,10 @@ func (self *JSRE) runEventLoop() { } return otto.UndefinedValue() } + self.vm.Set("setTimeout", setTimeout) + self.vm.Set("setInterval", setInterval) + self.vm.Set("clearTimeout", clearTimeout) + self.vm.Set("clearInterval", clearTimeout) var waitForCallbacks bool @@ -165,7 +169,7 @@ loop: _, err := self.vm.Call(`Function.call.call`, nil, arguments...) if err != nil { - break loop + fmt.Println("js error:", err, arguments) } if timer.interval { timer.timer.Reset(timer.duration) @@ -177,10 +181,6 @@ loop: } case evalReq := <-self.evalQueue: // run the code, send the result back - self.vm.Set("setTimeout", setTimeout) - self.vm.Set("setInterval", setInterval) - self.vm.Set("clearTimeout", clearTimeout) - self.vm.Set("clearInterval", clearTimeout) evalReq.fn(&evalReq.res) close(evalReq.done) if waitForCallbacks && (len(registry) == 0) { |