aboutsummaryrefslogtreecommitdiffstats
path: root/jsre
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-09-16 17:57:33 +0800
committerBas van Kervel <bas@ethdev.com>2015-09-16 17:57:33 +0800
commit2f65ddc50107399e867e28eca7e18ddd12b596c6 (patch)
tree2c67da55065c1b1fb4061f551a35f219c5497c67 /jsre
parente9a80518c72e0d5b2da7246a865f4dc4baab2cf9 (diff)
downloaddexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.tar
dexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.tar.gz
dexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.tar.bz2
dexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.tar.lz
dexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.tar.xz
dexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.tar.zst
dexon-2f65ddc50107399e867e28eca7e18ddd12b596c6.zip
jsre: timer bugfix when clearInterval was called from within the callback
Diffstat (limited to 'jsre')
-rw-r--r--jsre/jsre.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/jsre/jsre.go b/jsre/jsre.go
index 0db9e33fc..af7d507c6 100644
--- a/jsre/jsre.go
+++ b/jsre/jsre.go
@@ -154,7 +154,9 @@ loop:
if err != nil {
fmt.Println("js error:", err, arguments)
}
- if timer.interval {
+
+ _, inreg := registry[timer] // when clearInterval is called from within the callback don't reset it
+ if timer.interval && inreg {
timer.timer.Reset(timer.duration)
} else {
delete(registry, timer)