From 45f58abfdd7e3abc183f6a9b9353344cdb6ad06f Mon Sep 17 00:00:00 2001 From: Mihail Stoykov <312246+mstoykov@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:34:06 +0200 Subject: [PATCH] Update timers/timers.go Co-authored-by: Oleg Bespalov --- timers/timers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/timers/timers.go b/timers/timers.go index c10f145..be81146 100644 --- a/timers/timers.go +++ b/timers/timers.go @@ -119,8 +119,9 @@ func (e *Timers) timerInitialization(callback goja.Callable, timeout float64, ar } task := func() error { - if _, exist := e.timers[id]; !exist { - return nil // 8.1 + // Specification 8.1: If id does not exist in global's map of active timers, then abort these steps. + if _, exist := e.timers[id]; !exist + return nil } err := e.call(callback, args)