Skip to content
Permalink
Browse files
Be specific about Firefox nodes-as-nodelist. Never assume that modern…
… browsers will "get it right".

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Dec 11, 2012
1 parent 07a7b3e commit 3c7f2af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
@@ -919,6 +919,10 @@ function isArraylike( obj ) {
return false;
}

if ( obj.nodeType === 1 && length ) {
return true;
}

return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
@@ -1141,7 +1141,9 @@ test("jQuery.makeArray", function(){

equal( jQuery.makeArray(/a/)[0].constructor, RegExp, "Pass makeArray a regex" );

ok( jQuery.makeArray(document.getElementById("form")).length >= 13, "Pass makeArray a form (treat as elements)" );
// Some nodes inherit traits of nodelists
ok( jQuery.makeArray(document.getElementById("form")).length >= 13,
"Pass makeArray a form (treat as elements)" );
});

test("jQuery.inArray", function(){

0 comments on commit 3c7f2af

Please sign in to comment.