Bug Tracker

Opened 9 years ago

Closed 9 years ago

#13559 closed bug (invalid)

isWindow check in $.isPlainObject is redundant

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:


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.

Change History (2)

comment:1 Changed 9 years ago by Rick Waldron

Owner: set to [email protected]
Status: newpending

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?

comment:2 Changed 9 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

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!

Note: See TracTickets for help on using tickets.