🌐 AI搜索 & 代理 主页
Skip to content

Commit 0452428

Browse files
committed
Switched jQuery() to represent jQuery([]) instead of jQuery(document).
1 parent b846ad4 commit 0452428

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/core.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Define a local copy of jQuery
22
var jQuery = function( selector, context ) {
33
// The jQuery object is actually just the init constructor 'enhanced'
4-
return arguments.length === 0 ?
5-
rootjQuery :
6-
new jQuery.fn.init( selector, context );
4+
return new jQuery.fn.init( selector, context );
75
},
86

97
// Map over jQuery in case of overwrite

test/unit/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test("jQuery()", function() {
1616

1717
// Basic constructor's behavior
1818

19-
equals( jQuery().length, 1, "jQuery() === jQuery(document)" );
19+
equals( jQuery().length, 0, "jQuery() === jQuery([])" );
2020
equals( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
2121
equals( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
2222
equals( jQuery("").length, 0, "jQuery('') === jQuery([])" );

0 commit comments

Comments
 (0)