From f0bf2bcd66c3210ef1088903b86e847fe940e16d Mon Sep 17 00:00:00 2001 From: Diego Casorran Date: Mon, 7 Sep 2015 20:14:34 +0200 Subject: [PATCH] Call setTimeout with function expression. In order to prevent vulnerabilities, the `setTimeout` and `setInterval` functions should be called only with function expressions as their first argument. --- jquery.mousewheel.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jquery.mousewheel.js b/jquery.mousewheel.js index 3eadb7ed..4d6a080d 100755 --- a/jquery.mousewheel.js +++ b/jquery.mousewheel.js @@ -198,15 +198,13 @@ // a different lowestDelta // Ex: trackpad = 3 and mouse wheel = 120 if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } - nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); + nullLowestDeltaTimeout = setTimeout(function() { + lowestDelta = null; + }, 200); return ($.event.dispatch || $.event.handle).apply(this, args); } - function nullLowestDelta() { - lowestDelta = null; - } - function shouldAdjustOldDeltas(orgEvent, absDelta) { // If this is an older event and the delta is divisable by 120, // then we are assuming that the browser is treating this as an