CodeMirror 2: JavaScript mode

      function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
 1
2
3
4
5
6
 
// Demo code (the actual new parser character stream implementation)
 
function StringStream(string) {
  this.pos = 0;
  this.string = string;
}

JavaScript mode supports a single configuration option, json, which will set the mode to expect JSON data rather than a JavaScript program.

MIME types defined: text/javascript, application/json.