src/iframe-helper.js
/**
 * Removes any listenFors registed on listenSentinel that do not have
 * a contentWindow (the frame was removed from the DOM tree).
 * @param {!Array<!WindowEventsDef>} listenSentinel
 */
Removes any listenFors registed on listenSentinel that do not have
a contentWindow (the frame was removed from the DOM tree).
@param {!Array} listenSentinel
Removes any listenFors registed on listenSentinel that do not have a contentWindow ( the frame was removed from the DOM tree ) . @param { !Array } listenSentinel
function dropListenSentinel(listenSentinel) {
  const noopData = dict({'sentinel': UNLISTEN_SENTINEL});
  for (let i = listenSentinel.length - 1; i >= 0; i--) {
    const windowEvents = listenSentinel[i];
    if (!windowEvents.frame.contentWindow) {
      listenSentinel.splice(i, 1);
      const events = windowEvents.events;
      for (const name in events) {
        events[name].splice(0, Infinity).forEach(event => {
          event(noopData);
        });
      }
    }
  }
}
function dropListenSentinel ( listenSentinel ) { const noopData = dict ( { 'sentinel' : UNLISTEN_SENTINEL } ) ; for ( let i = listenSentinel . length - 1 ; i >= 0 ; i -- ) { const windowEvents = listenSentinel [ i ] ; if ( ! windowEvents . frame . contentWindow ) { listenSentinel . splice ( i , 1 ) ; const events = windowEvents . events ; for ( const name in events ) { events [ name ] . splice ( 0 , Infinity ) . forEach ( event => { event ( noopData ) ; } ) ; } } } }
Removes any listenFors registed on listenSentinel that do not have
 a contentWindow (the frame was removed from the DOM tree).
Removes any listenFors registed on listenSentinel that do not have a contentWindow ( the frame was removed from the DOM tree ) .
// Splice here, so that each unlisten does not shift the array