File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -919,6 +919,10 @@ function isArraylike( obj ) {
919
919
return false ;
920
920
}
921
921
922
+ if ( obj . nodeType === 1 && length ) {
923
+ return true ;
924
+ }
925
+
922
926
return type === "array" || type !== "function" &&
923
927
( length === 0 ||
924
928
typeof length === "number" && length > 0 && ( length - 1 ) in obj ) ;
Original file line number Diff line number Diff line change @@ -1141,7 +1141,9 @@ test("jQuery.makeArray", function(){
1141
1141
1142
1142
equal ( jQuery . makeArray ( / a / ) [ 0 ] . constructor , RegExp , "Pass makeArray a regex" ) ;
1143
1143
1144
- ok ( jQuery . makeArray ( document . getElementById ( "form" ) ) . length >= 13 , "Pass makeArray a form (treat as elements)" ) ;
1144
+ // Some nodes inherit traits of nodelists
1145
+ ok ( jQuery . makeArray ( document . getElementById ( "form" ) ) . length >= 13 ,
1146
+ "Pass makeArray a form (treat as elements)" ) ;
1145
1147
} ) ;
1146
1148
1147
1149
test ( "jQuery.inArray" , function ( ) {
You can’t perform that action at this time.
0 commit comments