For-loop in decoder script

I try to use a for loop with incomplete syntax like this because I must increment inside of the code block depending on other values.

for ( statement 1 ; statement 2 ; ) { code block }

Javascript docu (JavaScript for Loop) says it´s allowed, but I get an error message: “execute js error: execution timeout”

It IS allowed and it´s working in the decoder script.
The reason for the error message was somewhere else.