Reading jQuery 1.8 test/unit/effects.js test, what is it trying to test here?
var speeds = {
'null speed' : null,
'undefined speed': undefined,
'false speed': false
}
// make sure passing bogus arguments doesn't change state var ?
jQuery.each( speeds,
function( name, speed ) {
pass = true;
div.hide()
.show(speed)
.each( function() {
if( this.style.display == 'none' ) {
pass = false;
}
});
ok( pass, 'Show with ' + name );
});
As the comment in the code states, it makes sure that passing invalid values to the
.show()method won’t break it. That is,.show( null ),.show( undefined )and.show( false )all display the element even though the parameter is invalid.