Skip to content
Permalink
Browse files

Fixed problem with $("div",$("body")) breaking (returning an array, o…

…f length one, containing undefined).
  • Loading branch information
jeresig committed Jan 7, 2007
1 parent 0798c6e commit 33662cd713c28b2db0adccec170ffe93b35f098a
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/jquery/jquery.js
  2. +2 −2 src/selector/selector.js
@@ -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;
}
});
});

0 comments on commit 33662cd

Please sign in to comment.
You can’t perform that action at this time.