From 59d08c66ff31216fdb21834b2b3a47e5e8582f0b Mon Sep 17 00:00:00 2001 From: anim001k <140460766+anim001k@users.noreply.github.com> Date: Tue, 28 Oct 2025 12:34:14 +0100 Subject: [PATCH] internal/jsre: pass correct args to setTimeout/setInterval callbacks (#32936) ## Description - Summary: Correct the JS timer callback argument forwarding to match standard JS semantics. - What changed: In `internal/jsre/jsre.go`, the callback is now invoked with only the arguments after the callback and delay. - Why: Previously, the callback received the function and delay as parameters, causing unexpected behavior and logic bugs for consumers. --- internal/jsre/jsre.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index 0dfeae8e1b..4512115f16 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -201,7 +201,7 @@ loop: if !isFunc { panic(re.vm.ToValue("js error: timer/timeout callback is not a function")) } - call(goja.Null(), timer.call.Arguments...) + call(goja.Null(), timer.call.Arguments[2:]...) _, inreg := registry[timer] // when clearInterval is called from within the callback don't reset it if timer.interval && inreg {