marijnh/CodeMirror2 — pull request #527 by captn3m0 (2012-05-05 04:49:37+00:00)
Title: loadmode plugin does not work over non string modes

The json mode works with the mode being `{name:'javascript',json:true}`.

Running

CodeMirror.autoLoadMode(editor,{name:'javascript',json:true});

results in mode being converted to string and not being loaded. A simple type check for mode being an object fixes this (in loadmode.js)

mode = typeof mode == 'object' ? mode.name : mode;