JavaScript: fix parsing of regular expressions in a return statement