function callListener(listener, thisArg, event) {
  if (typeof listener === 'object' && listener.handleEvent) {
    listener.handleEvent.call(listener, event);
  } else {
    listener.call(thisArg, event);
  }
}
Call an event listener

@param {(Function|Object)} listener The listener to call
@param {*} thisArg The value to use as `this`` when calling the listener
@param {Event} event The event to pass to the listener
@private