B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Write out a value at the next line from the current insertion point.
   * The comment block will always be preceded by a newline character.
   * @param object aValue
   *        The Object to write out as a string
   */
Write out a value at the next line from the current insertion point.
The comment block will always be preceded by a newline character.
@param object aValue
The Object to write out as a string
Write out a value at the next line from the current insertion point . The comment block will always be preceded by a newline character . @param object aValue The Object to write out as a string
function SP_writeAsComment(aValue)
  {
    let selection = this.getSelectionRange();
    let insertionPoint = selection.start != selection.end ?
                         selection.end : 
                         this.editor.getCharCount(); 
    let newComment = "\n/*\n" + aValue + "\n*/";
    this.setText(newComment, insertionPoint, insertionPoint);
    this.selectRange(insertionPoint, insertionPoint + newComment.length);
  }
function SP_writeAsComment ( aValue ) { let selection = this . getSelectionRange ( ) ; let insertionPoint = selection . start != selection . end ? selection . end : this . editor . getCharCount ( ) ; let newComment = "\n/*\n" + aValue + "\n*/" ; this . setText ( newComment , insertionPoint , insertionPoint ) ; this . selectRange ( insertionPoint , insertionPoint + newComment . length ) ; }
Write out a value at the next line from the current insertion point.
Write out a value at the next line from the current insertion point .
// after selected text // after text end // Select the new comment.