B2G/gecko/testing/marionette/marionette-server.js
/**
   * Helper method to send async messages to the content listener
   *
   * @param string name
   *        Suffix of the targetted message listener (Marionette:<suffix>)
   * @param object values
   *        Object to send to the listener
   */
Helper method to send async messages to the content listener
@param string name
Suffix of the targetted message listener (Marionette:)
@param object values
Object to send to the listener
Helper method to send async messages to the content listener @param string name Suffix of the targetted message listener ( Marionette : ) @param object values Object to send to the listener
function MDA_sendAsync(name, values, commandId, ignoreFailure) {
    let success = true;
    if (values instanceof Object && commandId) {
      values.command_id = commandId;
    }
    if (this.currentRemoteFrame !== null) {
      try {
        this.messageManager.sendAsyncMessage(
          "Marionette:" + name + this.currentRemoteFrame.targetFrameId, values);
      }
      catch(e) {
        if (!ignoreFailure) {
          success = false;
          let error = e;
          switch(e.result) {
            case Components.results.NS_ERROR_FAILURE:
              error = new FrameSendFailureError(this.currentRemoteFrame);
              break;
            case Components.results.NS_ERROR_NOT_INITIALIZED:
              error = new FrameSendNotInitializedError(this.currentRemoteFrame);
              break;
            default:
              break;
          }
          let code = error.hasOwnProperty('code') ? e.code : 500;
          this.sendError(error.toString(), code, error.stack, commandId);
        }
      }
    }
    else {
      this.messageManager.broadcastAsyncMessage(
        "Marionette:" + name + this.curBrowser.curFrameId, values);
    }
    return success;
  }
function MDA_sendAsync ( name , values , commandId , ignoreFailure ) { let success = true ; if ( values instanceof Object && commandId ) { values . command_id = commandId ; } if ( this . currentRemoteFrame !== null ) { try { this . messageManager . sendAsyncMessage ( "Marionette:" + name + this . currentRemoteFrame . targetFrameId , values ) ; } catch ( e ) { if ( ! ignoreFailure ) { success = false ; let error = e ; switch ( e . result ) { case Components . results . NS_ERROR_FAILURE : error = new FrameSendFailureError ( this . currentRemoteFrame ) ; break ; case Components . results . NS_ERROR_NOT_INITIALIZED : error = new FrameSendNotInitializedError ( this . currentRemoteFrame ) ; break ; default : break ; } let code = error . hasOwnProperty ( 'code' ) ? e . code : 500 ; this . sendError ( error . toString ( ) , code , error . stack , commandId ) ; } } } else { this . messageManager . broadcastAsyncMessage ( "Marionette:" + name + this . curBrowser . curFrameId , values ) ; } return success ; }
Helper method to send async messages to the content listener
 @param string name
        Suffix of the targetted message listener (Marionette:<suffix>)
 @param object values
        Object to send to the listener
Helper method to send async messages to the content listener @param string name Suffix of the targetted message listener ( Marionette : <suffix > ) @param object values Object to send to the listener