[javascript mode] Fix bug in comma-less expression handling

Closes #1696