fix typo in javascript generation code (fixes #34)