[javascript mode] Fix parsing of ES6 class bodies

Issue #2622