Skip to content
Browse files
Added test for passing null to .show()
  • Loading branch information
Scott Gonzalez authored and jeresig committed Nov 13, 2009
1 parent 9cd5866 commit 8cb8ae27d8e0c732b711d73d2ef71125b0a7769b
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/unit/fx.js
@@ -1,13 +1,19 @@

test("show()", function() {
var pass = true, div = jQuery("#main div");{
if ( == "none" ) pass = false;
ok( pass, "Show" );

pass = true;
div.hide().show(null).each(function() {
if ( == "none" ) pass = false;
ok( pass, "Show will null speed");

jQuery("#main").append('<div id="show-tests"><div><p><a href="#"></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>');

var old = jQuery("#show-tests table").show().css("display") !== "table";

3 comments on commit 8cb8ae2


This comment has been minimized.

Copy link

@DBJDBJ DBJDBJ replied Nov 13, 2009

There are jokers who pass number to $(). For some devious reasons. Can/should we add :

if ( "number" === typeof arguments[0] ) return ;

Into the $(), itself ?


This comment has been minimized.

Copy link

@jeresig jeresig replied Nov 13, 2009

No? I mean, otherwise we would be checking for every possible input and that doesn't really make much sense - I mean if someone wants to try and use jQuery in a non-standard way, we shouldn't really stop them (unless it's in an unintended way - such as passing in a null or undefined).


This comment has been minimized.

Copy link

@DBJDBJ DBJDBJ replied Nov 14, 2009


Please sign in to comment.