aboutsummaryrefslogtreecommitdiffstats
path: root/jsre/jsre.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-05-08 01:56:44 +0800
committerobscuren <geffobscura@gmail.com>2015-05-08 19:05:20 +0800
commit351d6b0d44d5efa78edfa0729972e43133bcf88c (patch)
treeb7d8399e43038dd6a605b1512f361a28bd37869e /jsre/jsre.go
parent03473d48c1436380b9248e65803ba56e1c584663 (diff)
downloadgo-tangerine-351d6b0d44d5efa78edfa0729972e43133bcf88c.tar.gz
go-tangerine-351d6b0d44d5efa78edfa0729972e43133bcf88c.tar.zst
go-tangerine-351d6b0d44d5efa78edfa0729972e43133bcf88c.zip
jsre, cmd/geth: updated web3.js and altered settimeout
Diffstat (limited to 'jsre/jsre.go')
-rw-r--r--jsre/jsre.go10
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) {