Fix for #1163
authorBrandon Aaron <brandon.aaron@gmail.com>
Sun, 13 May 2007 04:01:57 +0000 (04:01 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Sun, 13 May 2007 04:01:57 +0000 (04:01 +0000)
src/jquery/coreTest.js
src/jquery/jquery.js

index dc9c8ed..a0ae82a 100644 (file)
@@ -12,7 +12,7 @@ test("Basic requirements", function() {
 });
 
 test("$()", function() {
-       expect(3);
+       expect(4);
        
        var main = $("#main");
        isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
@@ -32,6 +32,9 @@ test("$()", function() {
                pass = false;
        }
        ok( pass, "$('&lt;tag&gt;') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );
+       
+       var form = $("form")[0];
+       equals( 15, $(form.elements).size(), "$(form.elements)" );
 });
 
 test("isFunction", function() {
index 6fb1d5d..8ef7062 100644 (file)
@@ -176,7 +176,7 @@ jQuery.fn = jQuery.prototype = {
 
                        // HANDLE: $(arraylike)
                        // Watch for when an array-like object is passed as the selector
-                       (a.jquery || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
+                       (a.jquery || a.length && a != window && (!a.nodeType || (jQuery.browser.msie && a.elements)) && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
 
                        // HANDLE: $(*)
                        [ a ] );