extensions/amp-analytics/0.1/test/test-iframe-transport-client.js
/**
   * Sends a message from the current window to itself
   * @param {string} type Type of the message.
   * @param {!JsonObject} object Message payload.
   */
Sends a message from the current window to itself
@param {string} type Type of the message.
@param {!JsonObject} object Message payload.
Sends a message from the current window to itself @param { string } type Type of the message . @param { !JsonObject } object Message payload .
function send(type, data) {
    const object = {};
    object['type'] = type;
    object['sentinel'] = sentinel;
    if (data['events']) {
      object['events'] = data['events'];
    } else {
      object['data'] = data;
    }
    const payload = 'amp-' + JSON.stringify(object);
    window.postMessage(payload, '*');
  }
function send ( type , data ) { const object = { } ; object [ 'type' ] = type ; object [ 'sentinel' ] = sentinel ; if ( data [ 'events' ] ) { object [ 'events' ] = data [ 'events' ] ; } else { object [ 'data' ] = data ; } const payload = 'amp-' + JSON . stringify ( object ) ; window . postMessage ( payload , '*' ) ; }
Sends a message from the current window to itself
 @param {string} type Type of the message.
Sends a message from the current window to itself @param { string } type Type of the message .
/*OK*/