Permalink
Browse files
Add some tests for jQuery.isWindow and make sure that we're operating…
… against an object before testing.
- Loading branch information
@@ -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; | ||
This comment has been minimized.
This comment has been minimized.
jeresig
Author
Member
|
||
}, | ||
|
||
type: function( obj ) { | ||
The obj test seems unnecessary.
return typeof obj === "object" && "setInterval" in obj;