Skip to main content

Bug Tracker

Side navigation

#9507 closed bug (wontfix)

Opened June 03, 2011 11:10AM UTC

Closed July 12, 2011 06:35PM UTC

Last modified July 12, 2011 07:00PM UTC

jQuery.isPlainObject( NodeList ) === true in IE 6, 7, 8

Reported by: rkatic Owned by:
Priority: low Milestone: 1.next
Component: core Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description
Attachments (0)
Change History (8)

Changed June 03, 2011 11:35AM UTC by rkatic comment:1

Changed June 04, 2011 05:14PM UTC by dmethvin comment:2

status: newopen

Not sure if this needs fixing, but see the discussion in the pull request.

Changed June 04, 2011 05:18PM UTC by rwaldron comment:3

@dmethvin

http://bugs.jquery.com/ticket/7780#comment:5

We discussed in the -dev channel not attempting to support every single host object.

Changed June 04, 2011 06:03PM UTC by rkatic comment:4

If a person uses isPlainObject, then it is likely that such person will also work more directly with the DOM (plugins). So I think it is important to support at least every DOM instance (no window.location or window.alert), and I think my solution would fix that.

Changed June 05, 2011 07:18PM UTC by rwaldron comment:5

Docs have been upated, see #7780

Changed June 05, 2011 07:19PM UTC by rwaldron comment:6

component: unfiledcore
priority: undecidedlow

Changed July 12, 2011 06:35PM UTC by ajpiano comment:7

_comment0: The consensus we've reached at this stime is that we will not be attempting to detect native/host objects in $.isPlainObject and $.map. While edge cases like this do come up, detection is unreliable and comes at a relatively high cognitive cost without clear benefit to the vast majority of jQuery users. If in the future, it becomes apparent that this issue is something that is a pain point to a larger contingent of developers, we can revisit the issue.1310495855845922
resolution: → wontfix
status: openclosed

The consensus we've reached at this stime is that we will not be attempting to detect host objects in $.isPlainObject and $.map. While edge cases like this do come up, detection is unreliable and comes at a relatively high cognitive cost without clear benefit to the vast majority of jQuery users. If in the future, it becomes apparent that this issue is something that is a pain point to a larger contingent of developers, we can revisit the issue.

Changed July 12, 2011 07:00PM UTC by rkatic comment:8

The consensus we've reached at this stime is that we will not be attempting to detect host objects in $.isPlainObject and $.map.

But it already does (window, node), and with my patch it improves the detection of those objects, plus detects other DOM instances like NodeList-s.

I am not extending isPlainObject to support all inputs (like window.location...), I am just making it more consistent...

While edge cases like this do come up, detection is unreliable and comes at a relatively high cognitive cost without clear benefit to the vast majority of jQuery users.

Are you saying that my patch is unreliable? Have you any argument, or it is not clear how it works? If it could help, I am disposed to explain it.