utils/events.js
function getDelegateFunction_(listener) {
  if (!delegateFunctionMap.has(listener)) {
    var delegateFunction =
      function(e) {
        e = e || window.event;
        var target = e.target || e.srcElement;
        target = target.nodeType === 3 ? target.parentNode : target;
        do {
          listener(target, e);
          if (target.parentNode) {
            target = target.parentNode;
          }
        } while (target.parentNode);
      };
    delegateFunctionMap.set(listener, delegateFunction);
  }
  return delegateFunctionMap.get(listener);
}
function getDelegateFunction_(listener) {
  if (!delegateFunctionMap.has(listener)) {
    var delegateFunction =
      function(e) {
        e = e || window.event;
        var target = e.target || e.srcElement;
        target = target.nodeType === 3 ? target.parentNode : target;
        do {
          listener(target, e);
          if (target.parentNode) {
            target = target.parentNode;
          }
        } while (target.parentNode);
      };
    delegateFunctionMap.set(listener, delegateFunction);
  }
  return delegateFunctionMap.get(listener);
}
function getDelegateFunction_ ( listener ) { if ( ! delegateFunctionMap . has ( listener ) ) { var delegateFunction = function ( e ) { e = e || window . event ; var target = e . target || e . srcElement ; target = target . nodeType === 3 ? target . parentNode : target ; do { listener ( target , e ) ; if ( target . parentNode ) { target = target . parentNode ; } } while ( target . parentNode ) ; } ; delegateFunctionMap . set ( listener , delegateFunction ) ; } return delegateFunctionMap . get ( listener ) ; }
Creates the delegate function that gets added during addDelegatedListener.
@param {Function} listener Listener function.
@private
Creates the delegate function that gets added during addDelegatedListener .