Add some tests for jQuery.isWindow and make sure that we're operating against an object before testing.

This commit is contained in:
jeresig 2010-09-22 16:50:38 -04:00
parent c8dd49f756
commit d7a6e75241
2 changed files with 20 additions and 1 deletions

View file

@ -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 ) {