Skip to content

Commit e710698

Browse files
committed
[javascript mode] Drop expected tokens when running into ), }, or ]
Issue codemirror#5431
1 parent a49a776 commit e710698

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mode/javascript/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
344344
function expect(wanted) {
345345
function exp(type) {
346346
if (type == wanted) return cont();
347-
else if (wanted == ";") return pass();
347+
else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass();
348348
else return cont(exp);
349349
};
350350
return exp;

0 commit comments

Comments
 (0)