Commit 2f65ddc5 authored by Bas van Kervel's avatar Bas van Kervel

jsre: timer bugfix when clearInterval was called from within the callback

parent e9a80518
...@@ -154,7 +154,9 @@ loop: ...@@ -154,7 +154,9 @@ loop:
if err != nil { if err != nil {
fmt.Println("js error:", err, arguments) 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) timer.timer.Reset(timer.duration)
} else { } else {
delete(registry, timer) delete(registry, timer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment