Add some tests for jQuery.isWindow and make sure that we're operating against an object before testing.
This commit is contained in:
parent
c8dd49f756
commit
d7a6e75241
2 changed files with 20 additions and 1 deletions
|
@ -476,7 +476,7 @@ jQuery.extend({
|
|||
|
||||
// A crude way of determining if an object is a window
|
||||
isWindow: function( obj ) {
|
||||
return "setInterval" in obj;
|
||||
return obj && typeof obj === "object" && "setInterval" in obj;
|
||||
},
|
||||
|
||||
type: function( obj ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue