Commit 04524287 authored by John Resig's avatar John Resig

Switched jQuery() to represent jQuery([]) instead of jQuery(document).

parent b846ad4c
// Define a local copy of jQuery // Define a local copy of jQuery
var jQuery = function( selector, context ) { var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced' // The jQuery object is actually just the init constructor 'enhanced'
return arguments.length === 0 ? return new jQuery.fn.init( selector, context );
rootjQuery :
new jQuery.fn.init( selector, context );
}, },
// Map over jQuery in case of overwrite // Map over jQuery in case of overwrite
......
...@@ -16,7 +16,7 @@ test("jQuery()", function() { ...@@ -16,7 +16,7 @@ test("jQuery()", function() {
// Basic constructor's behavior // Basic constructor's behavior
equals( jQuery().length, 1, "jQuery() === jQuery(document)" ); equals( jQuery().length, 0, "jQuery() === jQuery([])" );
equals( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" ); equals( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
equals( jQuery(null).length, 0, "jQuery(null) === jQuery([])" ); equals( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
equals( jQuery("").length, 0, "jQuery('') === jQuery([])" ); equals( jQuery("").length, 0, "jQuery('') === jQuery([])" );
......
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