code: function CodeMirror(place, options) {
      if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
  
      this.options = options = options || {};
      // Determine effective options based on given values and defaults.
      for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))
        options[opt] = defaults[opt];
      setGuttersForLineNumbers(options);
  
      var docStart = typeof options.value == "string" ? 0 : options.value.first;
      var display = this.display = makeDisplay(place, docStart);
      display.wrapper.CodeMirror = this;
      updateGutters(this);
      if (options.autofocus && !mobile) focusInput(this);
  
      this.state = {keyMaps: [],
                    overlays: [],
                    modeGen: 0,
                    overwrite: false, focused: false,
                    suppressEdits: false, pasteIncoming: false,
                    draggingText: false,
                    highlight: new Delayed()};
  
      themeChanged(this);
      if (options.lineWrapping)
        this.display.wrapper.className += " CodeMirror-wrap";
  
      var doc = options.value;
      if (typeof doc == "string") doc = new Doc(options.value, options.mode);
      operation(this, attachDoc)(this, doc);
  
      // Override magic textarea content restore that IE sometimes does
      // on our hidden textarea on reload
      if (ie) setTimeout(bind(resetInput, this, true), 20);
  
      registerEventHandlers(this);
      // IE throws unspecified error in certain cases, when
      // trying to access activeElement before onload
      var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }
      if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);
      else onBlur(this);
  
      operation(this, function() {
        for (var opt in optionHandlers)
          if (optionHandlers.propertyIsEnumerable(opt))
            optionHandlers[opt](this, options[opt], Init);
        for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
      })();
    }
docs: CONSTRUCTOR