Skip to main content

Bug Tracker

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 rwaldron comment:1

owner: → carson@carsonkahn.com
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?

Changed March 18, 2013 08:36AM UTC by trac-o-bot comment:2

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!