[javascript mode] More comma-handling tweaks

Issue #1443