mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Update grunt-contrib-jshint to 0.3.0, ref gh-1204.
This commit is contained in:
parent
65a6648932
commit
4adde5d145
@ -180,7 +180,7 @@ function uploadToCDN( next ) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
cmds.push( next );
|
cmds.push( next );
|
||||||
|
|
||||||
steps.apply( this, cmds );
|
steps.apply( this, cmds );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"grunt-git-authors": "1.2.0",
|
"grunt-git-authors": "1.2.0",
|
||||||
"grunt-update-submodules": "0.2.0",
|
"grunt-update-submodules": "0.2.0",
|
||||||
"grunt-contrib-watch": "0.3.1",
|
"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-contrib-uglify": "0.1.2",
|
||||||
"grunt": "0.4.1",
|
"grunt": "0.4.1",
|
||||||
"gzip-js": "0.3.1",
|
"gzip-js": "0.3.1",
|
||||||
|
@ -4,7 +4,7 @@ function benchmark(fn, times, name){
|
|||||||
var s = fn.indexOf('{')+1,
|
var s = fn.indexOf('{')+1,
|
||||||
e = fn.lastIndexOf('}');
|
e = fn.lastIndexOf('}');
|
||||||
fn = fn.substring(s,e);
|
fn = fn.substring(s,e);
|
||||||
|
|
||||||
return benchmarkString(fn, times, name);
|
return benchmarkString(fn, times, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,15 +3,17 @@
|
|||||||
"expr": true,
|
"expr": true,
|
||||||
"newcap": false,
|
"newcap": false,
|
||||||
"quotmark": "double",
|
"quotmark": "double",
|
||||||
"regexdash": true,
|
|
||||||
"trailing": true,
|
"trailing": true,
|
||||||
"undef": true,
|
"undef": true,
|
||||||
"unused": true,
|
"unused": true,
|
||||||
|
"latedef": false,
|
||||||
|
"eqeqeq": true,
|
||||||
"maxerr": 100,
|
"maxerr": 100,
|
||||||
|
|
||||||
"eqnull": true,
|
"eqnull": true,
|
||||||
"evil": true,
|
"evil": true,
|
||||||
"sub": true,
|
"sub": true,
|
||||||
|
"boss": true,
|
||||||
|
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"wsh": true,
|
"wsh": true,
|
||||||
|
@ -445,8 +445,8 @@ jQuery.extend({
|
|||||||
parts = rurl.exec( s.url.toLowerCase() );
|
parts = rurl.exec( s.url.toLowerCase() );
|
||||||
s.crossDomain = !!( parts &&
|
s.crossDomain = !!( parts &&
|
||||||
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
|
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
|
||||||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
|
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
|
||||||
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
|
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,14 +279,14 @@ jQuery.extend({
|
|||||||
options = elem.options,
|
options = elem.options,
|
||||||
values = jQuery.makeArray( value ),
|
values = jQuery.makeArray( value ),
|
||||||
i = options.length;
|
i = options.length;
|
||||||
|
|
||||||
while ( i-- ) {
|
while ( i-- ) {
|
||||||
option = options[ i ];
|
option = options[ i ];
|
||||||
if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
|
if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
|
||||||
optionSet = true;
|
optionSet = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// force browsers to behave consistently when non-matching value is set
|
// force browsers to behave consistently when non-matching value is set
|
||||||
if ( !optionSet ) {
|
if ( !optionSet ) {
|
||||||
elem.selectedIndex = -1;
|
elem.selectedIndex = -1;
|
||||||
|
@ -435,6 +435,7 @@ jQuery.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
isWindow: function( obj ) {
|
isWindow: function( obj ) {
|
||||||
|
/* jshint eqeqeq: false */
|
||||||
return obj != null && obj == obj.window;
|
return obj != null && obj == obj.window;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -169,7 +169,9 @@ function internalRemoveData( elem, name, pvt ) {
|
|||||||
jQuery.cleanData( [ elem ], true );
|
jQuery.cleanData( [ elem ], true );
|
||||||
|
|
||||||
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
|
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
|
||||||
|
/* jshint eqeqeq: false */
|
||||||
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
|
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
|
||||||
|
/* jshint eqeqeq: true */
|
||||||
delete cache[ id ];
|
delete cache[ id ];
|
||||||
|
|
||||||
// When all else fails, null
|
// When all else fails, null
|
||||||
|
8
src/effects.js
vendored
8
src/effects.js
vendored
@ -175,7 +175,7 @@ function Animation( elem, properties, options ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function propFilter( props, specialEasing ) {
|
function propFilter( props, specialEasing ) {
|
||||||
var value, name, index, easing, hooks;
|
var index, name, easing, value, hooks;
|
||||||
|
|
||||||
// camelCase, specialEasing and expand cssHook pass
|
// camelCase, specialEasing and expand cssHook pass
|
||||||
for ( index in props ) {
|
for ( index in props ) {
|
||||||
@ -242,7 +242,7 @@ jQuery.Animation = jQuery.extend( Animation, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function defaultPrefilter( elem, props, opts ) {
|
function defaultPrefilter( elem, props, opts ) {
|
||||||
/*jshint validthis:true */
|
/* jshint validthis: true */
|
||||||
var prop, index, length,
|
var prop, index, length,
|
||||||
value, dataShow, toggle,
|
value, dataShow, toggle,
|
||||||
tween, hooks, oldfire,
|
tween, hooks, oldfire,
|
||||||
@ -451,8 +451,8 @@ Tween.propHooks = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Remove in 2.0 - this supports IE8's panic based approach
|
// Support: IE <=9
|
||||||
// to setting things on disconnected nodes
|
// Panic based approach to setting things on disconnected nodes
|
||||||
|
|
||||||
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
|
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
|
||||||
set: function( tween ) {
|
set: function( tween ) {
|
||||||
|
@ -67,7 +67,7 @@ jQuery.event = {
|
|||||||
tmp = rtypenamespace.exec( types[t] ) || [];
|
tmp = rtypenamespace.exec( types[t] ) || [];
|
||||||
type = origType = tmp[1];
|
type = origType = tmp[1];
|
||||||
namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
||||||
|
|
||||||
// There *must* be a type, no attaching namespace-only handlers
|
// There *must* be a type, no attaching namespace-only handlers
|
||||||
if ( !type ) {
|
if ( !type ) {
|
||||||
continue;
|
continue;
|
||||||
@ -413,7 +413,9 @@ jQuery.event = {
|
|||||||
// Avoid non-left-click bubbling in Firefox (#3861)
|
// Avoid non-left-click bubbling in Firefox (#3861)
|
||||||
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
|
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
|
||||||
|
|
||||||
|
/* jshint eqeqeq: false */
|
||||||
for ( ; cur != this; cur = cur.parentNode || this ) {
|
for ( ; cur != this; cur = cur.parentNode || this ) {
|
||||||
|
/* jshint eqeqeq: true */
|
||||||
|
|
||||||
// Don't check non-elements (#13208)
|
// Don't check non-elements (#13208)
|
||||||
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
||||||
|
@ -337,7 +337,7 @@ var Globals = (function() {
|
|||||||
} else {
|
} else {
|
||||||
delete jQuery.ajaxSettings;
|
delete jQuery.ajaxSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup globals
|
// Cleanup globals
|
||||||
Globals.cleanup();
|
Globals.cleanup();
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ module( "ajax", {
|
|||||||
tmp.push( i, ": ", requestHeaders[ i ], "\n" );
|
tmp.push( i, ": ", requestHeaders[ i ], "\n" );
|
||||||
}
|
}
|
||||||
tmp = tmp.join("");
|
tmp = tmp.join("");
|
||||||
|
|
||||||
strictEqual( data, tmp, "Headers were sent" );
|
strictEqual( data, tmp, "Headers were sent" );
|
||||||
strictEqual( xhr.getResponseHeader("Sample-Header"), "Hello World", "Sample header received" );
|
strictEqual( xhr.getResponseHeader("Sample-Header"), "Hello World", "Sample header received" );
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ module( "ajax", {
|
|||||||
samePort = loc.port || ( loc.protocol === "http:" ? 80 : 443 ),
|
samePort = loc.port || ( loc.protocol === "http:" ? 80 : 443 ),
|
||||||
otherPort = loc.port === 666 ? 667 : 666,
|
otherPort = loc.port === 666 ? 667 : 666,
|
||||||
otherProtocol = loc.protocol === "http:" ? "https:" : "http:";
|
otherProtocol = loc.protocol === "http:" ? "https:" : "http:";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
request(
|
request(
|
||||||
loc.protocol + "//" + loc.host + ":" + samePort,
|
loc.protocol + "//" + loc.host + ":" + samePort,
|
||||||
@ -390,7 +390,7 @@ module( "ajax", {
|
|||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxTest( "jQuery.ajax() - events without context", 3, function() {
|
ajaxTest( "jQuery.ajax() - events without context", 3, function() {
|
||||||
function nocallback( msg ) {
|
function nocallback( msg ) {
|
||||||
return function() {
|
return function() {
|
||||||
@ -601,9 +601,9 @@ module( "ajax", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ajaxTest( "jQuery.ajax() - cache", 12, function() {
|
ajaxTest( "jQuery.ajax() - cache", 12, function() {
|
||||||
|
|
||||||
var re = /_=(.*?)(&|$)/g;
|
var re = /_=(.*?)(&|$)/g;
|
||||||
|
|
||||||
function request( url, title ) {
|
function request( url, title ) {
|
||||||
return {
|
return {
|
||||||
url: url,
|
url: url,
|
||||||
@ -620,7 +620,7 @@ module( "ajax", {
|
|||||||
error: true
|
error: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
request(
|
request(
|
||||||
"data/text.php",
|
"data/text.php",
|
||||||
@ -1356,7 +1356,7 @@ module( "ajax", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
jQuery.each( [ " - Same Domain", " - Cross Domain" ], function( crossDomain, label ) {
|
jQuery.each( [ " - Same Domain", " - Cross Domain" ], function( crossDomain, label ) {
|
||||||
ajaxTest( "#8205 - jQuery.ajax() - JSONP - re-use callbacks name" + label, 2, {
|
ajaxTest( "#8205 - jQuery.ajax() - JSONP - re-use callbacks name" + label, 2, {
|
||||||
url: "data/jsonp.php",
|
url: "data/jsonp.php",
|
||||||
@ -1401,7 +1401,7 @@ module( "ajax", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
jQuery.each( [ "as argument", "in settings object" ], function( inSetting, title ) {
|
jQuery.each( [ "as argument", "in settings object" ], function( inSetting, title ) {
|
||||||
|
|
||||||
function request( url, test ) {
|
function request( url, test ) {
|
||||||
return {
|
return {
|
||||||
create: function() {
|
create: function() {
|
||||||
@ -1412,14 +1412,14 @@ module( "ajax", {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ajaxTest( "#10093 - jQuery.ajax() - falsy url " + title, 4, [
|
ajaxTest( "#10093 - jQuery.ajax() - falsy url " + title, 4, [
|
||||||
request( "", "empty string" ),
|
request( "", "empty string" ),
|
||||||
request( false ),
|
request( false ),
|
||||||
request( null ),
|
request( null ),
|
||||||
request( undefined )
|
request( undefined )
|
||||||
]);
|
]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxTest( "#11151 - jQuery.ajax() - parse error body", 2, {
|
ajaxTest( "#11151 - jQuery.ajax() - parse error body", 2, {
|
||||||
@ -1492,7 +1492,7 @@ module( "ajax", {
|
|||||||
request()
|
request()
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxTest( "#13276 - jQuery.ajax() - compatibility between XML documents from ajax requests and parsed string", 1, {
|
ajaxTest( "#13276 - jQuery.ajax() - compatibility between XML documents from ajax requests and parsed string", 1, {
|
||||||
@ -1510,7 +1510,7 @@ module( "ajax", {
|
|||||||
strictEqual( ajaxXML.find("tab").length, 3, "Parsed node was added properly" );
|
strictEqual( ajaxXML.find("tab").length, 3, "Parsed node was added properly" );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxTest( "#13292 - jQuery.ajax() - converter is bypassed for 204 requests", 3, {
|
ajaxTest( "#13292 - jQuery.ajax() - converter is bypassed for 204 requests", 3, {
|
||||||
url: "data/nocontent.php",
|
url: "data/nocontent.php",
|
||||||
dataType: "testing",
|
dataType: "testing",
|
||||||
@ -1744,7 +1744,7 @@ module( "ajax", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//----------- jQuery.fn.load()
|
//----------- jQuery.fn.load()
|
||||||
|
|
||||||
// check if load can be called with only url
|
// check if load can be called with only url
|
||||||
asyncTest( "jQuery.fn.load( String )", 2, function() {
|
asyncTest( "jQuery.fn.load( String )", 2, function() {
|
||||||
jQuery.ajaxSetup({
|
jQuery.ajaxSetup({
|
||||||
|
@ -852,17 +852,17 @@ test( "val()", function() {
|
|||||||
|
|
||||||
test("val() with non-matching values on dropdown list", function() {
|
test("val() with non-matching values on dropdown list", function() {
|
||||||
expect( 3 );
|
expect( 3 );
|
||||||
|
|
||||||
jQuery("#select5").val( "" );
|
jQuery("#select5").val( "" );
|
||||||
equal( jQuery("#select5").val(), null, "Non-matching set on select-one" );
|
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");
|
var select6 = jQuery("<select multiple id=\"select6\"><option value=\"1\">A</option><option value=\"2\">B</option></select>").appendTo("#form");
|
||||||
jQuery(select6).val( "nothing" );
|
jQuery(select6).val( "nothing" );
|
||||||
equal( jQuery(select6).val(), null, "Non-matching set (single value) on select-multiple" );
|
equal( jQuery(select6).val(), null, "Non-matching set (single value) on select-multiple" );
|
||||||
|
|
||||||
jQuery(select6).val( ["nothing1", "nothing2"] );
|
jQuery(select6).val( ["nothing1", "nothing2"] );
|
||||||
equal( jQuery(select6).val(), null, "Non-matching set (array of values) on select-multiple" );
|
equal( jQuery(select6).val(), null, "Non-matching set (array of values) on select-multiple" );
|
||||||
|
|
||||||
select6.remove();
|
select6.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user