I have often found myself doing things in bonsai commits I wouldn’t do in my normal development, but I tried to stick to the coding style of the files around it. (See https://github.com/uxebu/bonsai/blob/master/src/runner/animation/translators/segment.js again).

Though now that I’ve gone through the other translators, it seems that the segment translator is the only one that includes variable declaration within for loops.