Replaced usage of onEnd with usage of CodeEmitter.add in visitClosure in
BodyVisitor.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>