[javascript mode] Fix parsing of ops and derefs after function literal

Closes #2381