B2G/gecko/browser/devtools/debugger/debugger-controller.js
/**
   * Sets the proper editor mode (JS or HTML) according to the specified
   * content type, or by determining the type from the URL.
   *
   * @param string aUrl
   *        The script URL.
   * @param string aContentType [optional]
   *        The script content type.
   */
Sets the proper editor mode (JS or HTML) according to the specified
content type, or by determining the type from the URL.

@param string aUrl
The script URL.
@param string aContentType [optional]
The script content type.
Sets the proper editor mode ( JS or HTML ) according to the specified content type or by determining the type from the URL . @param string aUrl The script URL . @param string aContentType [ optional ] The script content type .
function SS__setEditorMode(aUrl, aContentType) {
    if (aContentType) {
      if (/javascript/.test(aContentType)) {
        DebuggerView.editor.setMode(SourceEditor.MODES.JAVASCRIPT);
      } else {
        DebuggerView.editor.setMode(SourceEditor.MODES.HTML);
      }
      return;
    }
    if (/\.jsm?$/.test(this.trimUrlQuery(aUrl))) {
      DebuggerView.editor.setMode(SourceEditor.MODES.JAVASCRIPT);
    } else {
      DebuggerView.editor.setMode(SourceEditor.MODES.HTML);
    }
  }
function SS__setEditorMode ( aUrl , aContentType ) { if ( aContentType ) { if ( / javascript / . test ( aContentType ) ) { DebuggerView . editor . setMode ( SourceEditor . MODES . JAVASCRIPT ) ; } else { DebuggerView . editor . setMode ( SourceEditor . MODES . HTML ) ; } return ; } if ( / \.jsm?$ / . test ( this . trimUrlQuery ( aUrl ) ) ) { DebuggerView . editor . setMode ( SourceEditor . MODES . JAVASCRIPT ) ; } else { DebuggerView . editor . setMode ( SourceEditor . MODES . HTML ) ; } }
Sets the proper editor mode (JS or HTML) according to the specified
 content type, or by determining the type from the URL.
Sets the proper editor mode ( JS or HTML ) according to the specified content type or by determining the type from the URL .
// Use JS mode for files with .js and .jsm extensions.