B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Write out an error at the current insertion point as a block comment
   * @param object aValue
   *        The Error object to write out the message and stack trace
   */
Write out an error at the current insertion point as a block comment
@param object aValue
The Error object to write out the message and stack trace
Write out an error at the current insertion point as a block comment @param object aValue The Error object to write out the message and stack trace
function SP_writeAsErrorComment(aError)
  {
    let stack = "";
    if (aError.stack) {
      stack = aError.stack;
    }
    else if (aError.fileName) {
      if (aError.lineNumber) {
        stack = "@" + aError.fileName + ":" + aError.lineNumber;
      }
      else {
        stack = "@" + aError.fileName;
      }
    }
    else if (aError.lineNumber) {
      stack = "@" + aError.lineNumber;
    }
    let newComment = "Exception: " + ( aError.message || aError) + ( stack == "" ? stack : "\n" + stack.replace(/\n$/, "") );
    this.writeAsComment(newComment);
  }
function SP_writeAsErrorComment ( aError ) { let stack = "" ; if ( aError . stack ) { stack = aError . stack ; } else if ( aError . fileName ) { if ( aError . lineNumber ) { stack = "@" + aError . fileName + ":" + aError . lineNumber ; } else { stack = "@" + aError . fileName ; } } else if ( aError . lineNumber ) { stack = "@" + aError . lineNumber ; } let newComment = "Exception: " + ( aError . message || aError ) + ( stack == "" ? stack : "\n" + stack . replace ( / \n$ / , "" ) ) ; this . writeAsComment ( newComment ) ; }
Write out an error at the current insertion point as a block comment
 @param object aValue
        The Error object to write out the message and stack trace
Write out an error at the current insertion point as a block comment @param object aValue The Error object to write out the message and stack trace