B2G/gecko/toolkit/devtools/webconsole/dbg-webconsole-actors.js
/**
   * Prepare a message from the console API to be sent to the remote Web Console
   * instance.
   *
   * @param object aMessage
   *        The original message received from console-api-log-event.
   * @return object
   *         The object that can be sent to the remote client.
   */
Prepare a message from the console API to be sent to the remote Web Console
instance.

@param object aMessage
The original message received from console-api-log-event.
@return object
The object that can be sent to the remote client.
Prepare a message from the console API to be sent to the remote Web Console instance . @param object aMessage The original message received from console - api - log - event . @return object The object that can be sent to the remote client .
function WCA_prepareConsoleMessageForRemote(aMessage)
  {
    let result = {
      level: aMessage.level,
      filename: aMessage.filename,
      lineNumber: aMessage.lineNumber,
      functionName: aMessage.functionName,
      timeStamp: aMessage.timeStamp,
    };
    switch (result.level) {
      case "trace":
      case "group":
      case "groupCollapsed":
      case "time":
      case "timeEnd":
        result.arguments = aMessage.arguments;
        break;
      default:
        result.arguments = Array.map(aMessage.arguments || [],
          function(aObj) {
            return this.createValueGrip(aObj);
          }, this);
        if (result.level == "dir") {
          result.objectProperties = [];
          let first = result.arguments[0];
          if (typeof first == "object" && first && first.inspectable) {
            let actor = this.getObjectActorByID(first.actor);
            result.objectProperties = actor.onInspectProperties().properties;
          }
        }
        break;
    }
    return result;
  }
function WCA_prepareConsoleMessageForRemote ( aMessage ) { let result = { level : aMessage . level , filename : aMessage . filename , lineNumber : aMessage . lineNumber , functionName : aMessage . functionName , timeStamp : aMessage . timeStamp , } ; switch ( result . level ) { case "trace" : case "group" : case "groupCollapsed" : case "time" : case "timeEnd" : result . arguments = aMessage . arguments ; break ; default : result . arguments = Array . map ( aMessage . arguments || [ ] , function ( aObj ) { return this . createValueGrip ( aObj ) ; } , this ) ; if ( result . level == "dir" ) { result . objectProperties = [ ] ; let first = result . arguments [ 0 ] ; if ( typeof first == "object" && first && first . inspectable ) { let actor = this . getObjectActorByID ( first . actor ) ; result . objectProperties = actor . onInspectProperties ( ) . properties ; } } break ; } return result ; }
Prepare a message from the console API to be sent to the remote Web Console
 instance.
Prepare a message from the console API to be sent to the remote Web Console instance .