Merge pull request #1811 from bas-vk/timer-clearinterval

timer bugfix when clearInterval was called from within the callback
release/1.3.2
Felix Lange 9 years ago
commit 69f48e4689
  1. 4
      jsre/jsre.go

@ -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)

Loading…
Cancel
Save