Opened 12 years ago
Closed 12 years ago
#7955 closed bug (invalid)
isPlainObject slight error
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | misc | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The return value for this is: for(key in obj) { }
hasOwn.call( obj, key ); |
Unless I'm mistaken, shouldn't key === undefined actually be key !== undefined? If key is undefined that would mean the for..in loop found no properties.
Change History (1)
comment:1 Changed 12 years ago by
Component: | unfiled → misc |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Thanks for taking the time to contribute to the jQuery project by writing a bug report.
There is no bug here. The conditional is correct (an object with no properties is still an object).
If you would switch
===
to!==
thenisPlainObject
would yield wrong results. E.g.