Commit 414d0599 authored by John Resig's avatar John Resig

Fixed a bug where nothing was passed in to $(), it would bomb out.

parent 21400772
...@@ -17,6 +17,10 @@ window.undefined = window.undefined; ...@@ -17,6 +17,10 @@ window.undefined = window.undefined;
* @constructor * @constructor
*/ */
function jQuery(a,c) { function jQuery(a,c) {
// Make sure t hat a selection was provided
a = a || jQuery.context || document;
/* /*
* Handle support for overriding other $() functions. Way too many libraries * Handle support for overriding other $() functions. Way too many libraries
* provide this function to simply ignore it and overwrite it. * provide this function to simply ignore it and overwrite it.
...@@ -35,9 +39,6 @@ function jQuery(a,c) { ...@@ -35,9 +39,6 @@ function jQuery(a,c) {
// Use the default method, in case it works some voodoo // Use the default method, in case it works some voodoo
return jQuery._$( a ); return jQuery._$( a );
// Make sure t hat a selection was provided
a = a || jQuery.context || document;
// Watch for when a jQuery object is passed as the selector // Watch for when a jQuery object is passed as the selector
if ( a.jquery ) if ( a.jquery )
return a; return a;
......
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