Skip to content

Commit

Permalink
[javascript mode] Fix potentially-exponential regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Oct 9, 2020
1 parent cdb228a commit 55d0333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mode/javascript/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var kw = keywords[word]
return ret(kw.type, kw.style, word)
}
if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false))
if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
return ret("async", "keyword", word)
}
return ret("variable", "variable", word)
Expand Down

0 comments on commit 55d0333

Please sign in to comment.