UNPKG

400 BJavaScriptView Raw
1// Test via a getter in the options object to see if the passive property is accessed
2var supportsPassive = false;
3
4try {
5 var opts = Object.defineProperty({}, 'passive', {
6 get: function get() {
7 supportsPassive = true;
8 }
9 });
10 window.addEventListener('testPassive', null, opts);
11 window.removeEventListener('testPassive', null, opts);
12} catch (e) {}
13
14export default supportsPassive;
\No newline at end of file