internal/jsre: remove unused timer arguments allocation

This commit is contained in:
Forostovec 2026-01-18 19:20:04 +02:00 committed by GitHub
parent ef815c59a2
commit 1efbfce660
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,17 +186,6 @@ loop:
select {
case timer := <-ready:
// execute callback, remove/reschedule the timer
var arguments []interface{}
if len(timer.call.Arguments) > 2 {
tmp := timer.call.Arguments[2:]
arguments = make([]interface{}, 2+len(tmp))
for i, value := range tmp {
arguments[i+2] = value
}
} else {
arguments = make([]interface{}, 1)
}
arguments[0] = timer.call.Arguments[0]
call, isFunc := goja.AssertFunction(timer.call.Arguments[0])
if !isFunc {
panic(re.vm.ToValue("js error: timer/timeout callback is not a function"))