vendor/assets/javascripts/codemirror/modes/javascript.js in codemirror-rails-4.12 vs vendor/assets/javascripts/codemirror/modes/javascript.js in codemirror-rails-4.13
- old
+ new
@@ -116,10 +116,10 @@
stream.skipToEnd();
return ret("comment", "comment");
} else if (state.lastType == "operator" || state.lastType == "keyword c" ||
state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
readRegexp(stream);
- stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
+ stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
return ret("regexp", "string-2");
} else {
stream.eatWhile(isOperatorChar);
return ret("operator", "operator", stream.current());
}