{"comment":{"created_at":"2011-10-08T15:06:08Z","body":"well, the question also is \"Is the extra versatility needed\"? I think @scottgonzalez's point is a good one. Unless there are reports of users running into issues with the current implementation, then the setInterval test is sufficient and also smaller and faster.","updated_at":"2011-10-08T15:06:08Z","url":"https://api.github.com/repos/jquery/jquery/issues/comments/2332419","id":2332419,"user":{"avatar_url":"https://secure.gravatar.com/avatar/a123410cfb9ea6510294a295bb548530?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/mikesherov","id":364532,"login":"mikesherov"}},"action":"created","issue":{"number":537,"created_at":"2011-10-08T10:18:56Z","pull_request":{"diff_url":"https://github.com/jquery/jquery/pull/537.diff","patch_url":"https://github.com/jquery/jquery/pull/537.patch","html_url":"https://github.com/jquery/jquery/pull/537"},"body":"The current `$.isWindow` simply looks to see if the object has a `setInterval` property to decide if it is a window.\r\n\r\nI've changed it to do a check that should be a little more robust (although still imperfect). What my implementation of `isWindow` does is:\r\n\r\n* Checks `obj` and `obj.document` are objects\r\n* Checks `obj.document`'s constructor is a function\r\n  * If so (Chrome), it tries to construct a new object with `obj.document`'s constructor. If it fails (you can't construct a new `HTMLDocument`), it decides `obj` is a window and returns true. Otherwise, it returns false.\r\n  * If not (Firefox, IE), it checks if `obj.document.constructor` is an `HTMLDocument` by calling `toString()` and checking if \"HTMLDocument\" is a substring.\r\n\r\nI've run the test suite on Chrome 14, Firefox 6 and Opera 11 on Mac OS X, and Internet Explorer 8 on Windows XP. The test suite passes on all browsers.\r\n\r\nI've also uncommented the 'fake window' test.","comments":4,"title":"Changed $.isWindow to be slightly less crude","updated_at":"2011-10-08T15:06:08Z","url":"https://api.github.com/repos/jquery/jquery/issues/537","id":1851860,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/bcb6acc9d0d9bef99e033b36c3d32ca9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/charliesome","id":179065,"login":"charliesome"},"html_url":"https://github.com/jquery/jquery/issues/537","labels":[],"state":"open"},"legacy":{"issue_id":1851860,"comment_id":2332419}}