Skip to content

Commit 2c5b6c6

Browse files
committed
Fixed #5
1 parent 86b3f25 commit 2c5b6c6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ node_modules
33
package-lock.json
44
test/public/bundle.js
55
.idea
6-
dist
6+
dist
7+
pnpm-lock.yaml

src/InfiniteLoading.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,23 @@
2626
* @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
2727
*/
2828
const thirdEventArg = (() => {
29-
let result = false;
29+
let supportsPassive = false;
3030
3131
try {
32-
const arg = Object.defineProperty({}, 'passive', {
32+
const opts = Object.defineProperty({}, 'passive', {
3333
get() {
34-
result = { passive: true };
34+
supportsPassive = { passive: true };
3535
return true;
3636
},
3737
});
3838
39-
window.addEventListener('testpassive', arg, arg);
40-
window.remove('testpassive', arg, arg);
41-
} catch (e) { /* */
39+
window.addEventListener('testPassive', null, opts);
40+
window.removeEventListener('testPassive', null, opts);
41+
} catch (e) {
42+
//
4243
}
4344
44-
return result;
45+
return supportsPassive;
4546
})();
4647
4748

0 commit comments

Comments
 (0)