aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-03-02 22:25:35 +0100
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-03-02 22:30:00 +0100
commit0fdfdd829000bffc37e4d32683a8881121faa767 (patch)
tree59e9dce9d951535b6c1c4dbf1b3d1d5c19fef9a9 /src
parent5ea844f65a820ebba7ae7c82af7bfab58f873e5a (diff)
downloadjquery-0fdfdd829000bffc37e4d32683a8881121faa767.tar.gz
jquery-0fdfdd829000bffc37e4d32683a8881121faa767.zip
Build: Enable ESLint one-var rule for var declarations in browser code
Node.js code is written more & more commonly in ES6+ so it doesn't make sense to enable it there. There are many violations in test code so it's disabled there as well. Closes gh-4615 (cherry picked from commit 4a7fc8544e2020c75047456d11979e4e3a517fdf)
Diffstat (limited to 'src')
-rw-r--r--src/css/support.js4
-rw-r--r--src/event.js7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/css/support.js b/src/css/support.js
index 6d9561def..fb2a1b204 100644
--- a/src/css/support.js
+++ b/src/css/support.js
@@ -103,7 +103,7 @@ define( [
// Behavior in IE 9 is more subtle than in newer versions & it passes
// some versions of this test; make sure not to make it pass there!
reliableTrDimensions: function() {
- var table, tr, trChild;
+ var table, tr, trChild, trStyle;
if ( reliableTrDimensionsVal == null ) {
table = document.createElement( "table" );
tr = document.createElement( "tr" );
@@ -118,7 +118,7 @@ define( [
.appendChild( tr )
.appendChild( trChild );
- var trStyle = window.getComputedStyle( tr );
+ trStyle = window.getComputedStyle( tr );
reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
documentElement.removeChild( table );
diff --git a/src/event.js b/src/event.js
index 79abf5614..734f6f020 100644
--- a/src/event.js
+++ b/src/event.js
@@ -308,11 +308,12 @@ jQuery.event = {
dispatch: function( nativeEvent ) {
- // Make a writable jQuery.Event from the native event object
- var event = jQuery.event.fix( nativeEvent );
-
var i, j, ret, matched, handleObj, handlerQueue,
args = new Array( arguments.length ),
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( nativeEvent ),
+
handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};