Switch debugging for javascript