Skip to content

Commit 55d0333

Browse files
committed
[javascript mode] Fix potentially-exponential regexp
1 parent cdb228a commit 55d0333

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/javascript/javascript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
126126
var kw = keywords[word]
127127
return ret(kw.type, kw.style, word)
128128
}
129-
if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false))
129+
if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
130130
return ret("async", "keyword", word)
131131
}
132132
return ret("variable", "variable", word)

0 commit comments

Comments
 (0)