Skip to content
Permalink
Browse files

Reverted optimization to jQuery function, fixing broken jQuery-as-con…

…text, added test (fix for #804)
  • Loading branch information
jzaefferer committed Jan 17, 2007
1 parent 6897390 commit 53e12752e00c2a86757ec15a0c871dee8ccd1bea
Showing with 11 additions and 6 deletions.
  1. +5 −0 src/jquery/coreTest.js
  2. +6 −6 src/jquery/jquery.js
@@ -11,6 +11,11 @@ test("Basic requirements", function() {
ok( $, "$()" );
});

test("$()", function() {
var main = $("#main");
isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
});

test("length", function() {
ok( $("div").length == 2, "Get Number of Elements Found" );
});
@@ -38,14 +38,14 @@ var jQuery = function(a,c) {

// Handle HTML strings
if ( typeof a == "string" ) {
// HANDLE: $(html) -> $(array)
var m = /^[^<]*(<.+>)[^>]*$/.exec(a);

a = m ?
// HANDLE: $(html) -> $(array)
jQuery.clean( [ m[1] ] ) :
if ( m )
a = jQuery.clean( [ m[1] ] );

// HANDLE: $(expr)
jQuery.find( a, c );
// HANDLE: $(expr)
else
return new jQuery( c ).find( a );
}

return this.setArray(

0 comments on commit 53e1275

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