Fix swap in jsgen
Merge pull request #1484 from def-/js-swap

Fix swap in jsgen