aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-03-14 00:23:36 +0100
committerDave Methvin <dave.methvin@gmail.com>2013-04-03 20:51:30 -0400
commit1205103a72db407bfbc0de3d9b78f1fd6a02520c (patch)
treeb80011049028520865ec59875bb6cded54f76f3f
parent9eb838e4189c7afbd187b4663923d97a608811ef (diff)
downloadjquery-1205103a72db407bfbc0de3d9b78f1fd6a02520c.tar.gz
jquery-1205103a72db407bfbc0de3d9b78f1fd6a02520c.zip
Update grunt-contrib-jshint to 0.3.0, close gh-1204.
(cherry picked from 4adde5d14534799f3bcfac2771e1513be8a56a2f) Conflicts: src/data.js src/effects.js
-rw-r--r--package.json2
-rw-r--r--src/.jshintrc4
-rw-r--r--src/ajax.js4
-rw-r--r--src/attributes.js4
-rw-r--r--src/core.js1
-rw-r--r--src/event.js2
-rw-r--r--test/unit/attributes.js8
7 files changed, 15 insertions, 10 deletions
diff --git a/package.json b/package.json
index b56b5c7bc..801848461 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"grunt-git-authors": "1.2.0",
"grunt-update-submodules": "0.2.0",
"grunt-contrib-watch": "0.3.1",
- "grunt-contrib-jshint": "0.1.1rc6",
+ "grunt-contrib-jshint": "0.3.0",
"grunt-contrib-uglify": "0.1.2",
"grunt": "0.4.1",
"gzip-js": "0.3.1",
diff --git a/src/.jshintrc b/src/.jshintrc
index fff75a6a8..b5b056f25 100644
--- a/src/.jshintrc
+++ b/src/.jshintrc
@@ -3,15 +3,17 @@
"expr": true,
"newcap": false,
"quotmark": "double",
- "regexdash": true,
"trailing": true,
"undef": true,
"unused": true,
+ "latedef": false,
+ "eqeqeq": true,
"maxerr": 100,
"eqnull": true,
"evil": true,
"sub": true,
+ "boss": true,
"browser": true,
"wsh": true,
diff --git a/src/ajax.js b/src/ajax.js
index 3ceb82c6d..e965a3e8a 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -444,8 +444,8 @@ jQuery.extend({
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
);
}
diff --git a/src/attributes.js b/src/attributes.js
index 37addf4a2..665e6ba9d 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -276,14 +276,14 @@ jQuery.extend({
options = elem.options,
values = jQuery.makeArray( value ),
i = options.length;
-
+
while ( i-- ) {
option = options[ i ];
if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
optionSet = true;
}
}
-
+
// force browsers to behave consistently when non-matching value is set
if ( !optionSet ) {
elem.selectedIndex = -1;
diff --git a/src/core.js b/src/core.js
index e8a3e0cd2..c0a32762d 100644
--- a/src/core.js
+++ b/src/core.js
@@ -404,6 +404,7 @@ jQuery.extend({
isArray: Array.isArray,
isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
return obj != null && obj == obj.window;
},
diff --git a/src/event.js b/src/event.js
index 4804e5a7d..33c8194c3 100644
--- a/src/event.js
+++ b/src/event.js
@@ -402,7 +402,9 @@ jQuery.event = {
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+ /* jshint eqeqeq: false */
for ( ; cur != this; cur = cur.parentNode || this ) {
+ /* jshint eqeqeq: true */
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.disabled !== true || event.type !== "click" ) {
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 5996ce15c..976869780 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -848,17 +848,17 @@ test( "val()", function() {
test("val() with non-matching values on dropdown list", function() {
expect( 3 );
-
+
jQuery("#select5").val( "" );
equal( jQuery("#select5").val(), null, "Non-matching set on select-one" );
-
+
var select6 = jQuery("<select multiple id=\"select6\"><option value=\"1\">A</option><option value=\"2\">B</option></select>").appendTo("#form");
jQuery(select6).val( "nothing" );
equal( jQuery(select6).val(), null, "Non-matching set (single value) on select-multiple" );
-
+
jQuery(select6).val( ["nothing1", "nothing2"] );
equal( jQuery(select6).val(), null, "Non-matching set (array of values) on select-multiple" );
-
+
select6.remove();
});