#9507 closed bug (wontfix)
jQuery.isPlainObject( NodeList ) === true in IE 6, 7, 8
Reported by: | Robert Katić | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | core | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Change History (8)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Status: | new → open |
---|
Not sure if this needs fixing, but see the discussion in the pull request.
comment:3 Changed 12 years ago by
@dmethvin
http://bugs.jquery.com/ticket/7780#comment:5
We discussed in the -dev channel not attempting to support every single host object.
comment:4 Changed 12 years ago by
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.
comment:6 Changed 12 years ago by
Component: | unfiled → core |
---|---|
Priority: | undecided → low |
comment:7 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | open → closed |
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.
comment:8 Changed 12 years ago by
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.
Patch: https://github.com/jquery/jquery/pull/402