JS backend: minor: correct names in DangerousTest
JS backend: complex expressions for varargs
JS backend: fix when with if inside