Side navigation
#13559 closed bug (invalid)
Opened March 03, 2013 06:00PM UTC
Closed March 18, 2013 08:36AM UTC
isWindow check in $.isPlainObject is redundant
Reported by: | carson@carsonkahn.com | Owned by: | carson@carsonkahn.com |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
By using jQuery.isWindow(obj) in the first line of $.isPlainObject, we're being redundant, because the first condition is !obj, but $.isWindow is basically !obj along with typeof obj === 'window'. So we're actually performing an obj == null check twice. Solution: use only typeof obj === 'window' instead.
Attachments (0)
Change History (2)
Changed March 03, 2013 06:34PM UTC by comment:1
owner: | → carson@carsonkahn.com |
---|---|
status: | new → pending |
Changed March 18, 2013 08:36AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
I assume you don't actually mean
obj === 'window'
ie. the string "window"?Is the use of jQuery.isWindow causing some buggy behaviour? How would jQuery benefit from having two different pieces of code doing the same thing, versus one shared?