// checks if the browser supports addEventListener options parameter defined as an object
// older browsers think the third parameter is a boolean
export var checkPassiveSupport = function checkPassiveSupport() {
  var passiveSupported = false;

  try {
    var options = {
      get passive() {
        // This function will be called when the browser
        //   attempts to access the passive property.
        passiveSupported = true;
        return false;
      }

    };
    window.addEventListener('test', null, options);
    window.removeEventListener('test', null, options);
  } catch (err) {
    passiveSupported = false;
  }

  return passiveSupported;
};