Skip to content

Commit b3482bb

Browse files
committed
[javascript mode] Fix a bug in parsing of arrow function with no args
Closes codemirror#4131
1 parent 5e29ee6 commit b3482bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/javascript/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
216216
var bracket = brackets.indexOf(ch);
217217
if (bracket >= 0 && bracket < 3) {
218218
if (!depth) { ++pos; break; }
219-
if (--depth == 0) break;
219+
if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
220220
} else if (bracket >= 3 && bracket < 6) {
221221
++depth;
222222
} else if (wordRE.test(ch)) {

0 commit comments

Comments
 (0)