]> source.dussan.org Git - jquery.git/commitdiff
4321 returns empty jquery object
authorrwldrn <waldron.rick@gmail.com>
Sat, 1 Jan 2011 22:13:04 +0000 (17:13 -0500)
committerrwldrn <waldron.rick@gmail.com>
Sat, 1 Jan 2011 22:13:04 +0000 (17:13 -0500)
src/core.js
test/unit/core.js

index 0211808c5b79b054fd3662fac70f2bb66741cb8f..fcbd1c358ebc1a8597be37b5683d232a052bc9dc 100644 (file)
@@ -17,7 +17,8 @@ var jQuery = function( selector, context ) {
 
        // A simple way to check for HTML strings or ID strings
        // (both of which we optimize for)
-       quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
+       quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
 
        // Is it a simple selector
        isSimple = /^.[^:#\[\.,]*$/,
index 9367ab10d93c0203f0cfbbaff235da9f89c04805..2563f17cb4a48d314f9ea4613938fd8a983c3f39 100644 (file)
@@ -12,7 +12,7 @@ test("Basic requirements", function() {
 });
 
 test("jQuery()", function() {
-       expect(24);
+       expect(25);
 
        strictEqual( commonJSDefined, jQuery, "CommonJS registered (Bug #7102)" );
 
@@ -22,6 +22,7 @@ test("jQuery()", function() {
        equals( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
        equals( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
        equals( jQuery("").length, 0, "jQuery('') === jQuery([])" );
+       equals( jQuery("#").length, 0, "jQuery('#') === jQuery([])" );
 
        var obj = jQuery("div")
        equals( jQuery(obj).selector, "div", "jQuery(jQueryObj) == jQueryObj" );