lib/core/utils/respondable.js
function post(win, topic, message, uuid, keepalive, callback) {
		var error;
		if (message instanceof Error) {
			error = {
				name: message.name,
				message: message.message,
				stack: message.stack
			};
			message = undefined;
		}

		var data = {
			uuid: uuid,
			topic: topic,
			message: message,
			error: error,
			_respondable: true,
			_source: _getSource(),
			_keepalive: keepalive
		};

		if (typeof callback === 'function') {
			messages[uuid] = callback;
		}

		win.postMessage(JSON.stringify(data), '*');
	}
function post(win, topic, message, uuid, keepalive, callback) {
		var error;
		if (message instanceof Error) {
			error = {
				name: message.name,
				message: message.message,
				stack: message.stack
			};
			message = undefined;
		}

		var data = {
			uuid: uuid,
			topic: topic,
			message: message,
			error: error,
			_respondable: true,
			_source: _getSource(),
			_keepalive: keepalive
		};

		if (typeof callback === 'function') {
			messages[uuid] = callback;
		}

		win.postMessage(JSON.stringify(data), '*');
	}
function post ( win , topic , message , uuid , keepalive , callback ) { var error ; if ( message instanceof Error ) { error = { name : message . name , message : message . message , stack : message . stack } ; message = undefined ; } var data = { uuid : uuid , topic : topic , message : message , error : error , _respondable : true , _source : _getSource ( ) , _keepalive : keepalive } ; if ( typeof callback === 'function' ) { messages [ uuid ] = callback ; } win . postMessage ( JSON . stringify ( data ) , '*' ) ; }
Posts the message to correct frame.
This abstraction necessary because IE9 & 10 do not support posting Objects; only strings
@private
@param  {Window}   win      The `window` to post the message to
@param  {String}   topic    The topic of the message
@param  {Object}   message  The message content
@param  {String}   uuid     The UUID, or pseudo-unique ID of the message
@param  {Boolean}  keepalive Whether to allow multiple responses - default is false
@param  {Function} callback The function to invoke when/if the message is responded to
Posts the message to correct frame . This abstraction necessary because IE9 & 10 do not support posting Objects ; only strings