mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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>
This commit is contained in:
parent
07a7b3e4cf
commit
3c7f2af81d
@ -919,6 +919,10 @@ function isArraylike( obj ) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( obj.nodeType === 1 && length ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return type === "array" || type !== "function" &&
|
return type === "array" || type !== "function" &&
|
||||||
( length === 0 ||
|
( length === 0 ||
|
||||||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
|
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" );
|
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(){
|
test("jQuery.inArray", function(){
|
||||||
|
Loading…
Reference in New Issue
Block a user