Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add some tests for jQuery.isWindow and make sure that we're operating…
… against an object before testing.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jeresig
Author
Member
|
||
}, | ||
|
||
type: function( obj ) { | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The obj test seems unnecessary.
return typeof obj === "object" && "setInterval" in obj;