Commit 33662cd7 authored by John Resig's avatar John Resig

Fixed problem with $("div",$("body")) breaking (returning an array, of length...

Fixed problem with $("div",$("body")) breaking (returning an array, of length one, containing undefined).
parent 0798c6e6
......@@ -1579,7 +1579,7 @@ jQuery.extend({
}
}
var r = [ result[0] ];
var r = result.length ? [ result[0] ] : [];
check: for ( var i = 1, rl = result.length; i < rl; i++ ) {
for ( var j = 0; j < i; j++ )
......
......@@ -101,7 +101,7 @@ jQuery.extend({
return [ t ];
// Make sure that the context is a DOM Element
if ( context && context.nodeType == undefined )
if ( context && !context.nodeType )
context = null;
// Set the correct context (if none is provided)
......@@ -423,4 +423,4 @@ jQuery.extend({
return r;
}
});
\ No newline at end of file
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment