Skip to content

Commit 2f65ddc

Browse files
author
Bas van Kervel
committed
jsre: timer bugfix when clearInterval was called from within the callback
1 parent e9a8051 commit 2f65ddc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jsre/jsre.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ loop:
154154
if err != nil {
155155
fmt.Println("js error:", err, arguments)
156156
}
157-
if timer.interval {
157+
158+
_, inreg := registry[timer] // when clearInterval is called from within the callback don't reset it
159+
if timer.interval && inreg {
158160
timer.timer.Reset(timer.duration)
159161
} else {
160162
delete(registry, timer)

0 commit comments

Comments
 (0)