Side navigation
#7467 closed bug (patchwelcome)
Opened November 11, 2010 01:18AM UTC
Closed November 11, 2010 02:27AM UTC
Last modified January 09, 2011 07:28PM UTC
$.each, $.extend, etc. should take care of JScript DontEnum bug
Reported by: | timmolendijk | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | core | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
See https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
Take this code:
$.each({a: 1, toString: 'x'}, function(k, v) { console.log(k); });
This should log:
a toString
This works in all browsers expect IE (I tested in version 8), in which it logs:
a
Attachments (0)
Change History (8)
Changed November 11, 2010 02:27AM UTC by comment:1
component: | unfiled → core |
---|---|
resolution: | → patchwelcome |
status: | new → closed |
Changed November 11, 2010 03:38AM UTC by comment:2
I know Prototype.js does this, but I think their implementation suffers performance.
Changed November 11, 2010 02:10PM UTC by comment:3
I think you meant to link to this:
Changed November 11, 2010 03:09PM UTC by comment:4
Yikes! that was the link to the patch file. Thanks Dave.
Changed November 11, 2010 03:26PM UTC by comment:5
Yep I'm currently successfully using a similar work-around.
Changed January 04, 2011 01:53AM UTC by comment:7
This affects JQuery's extend function in that it will sometimes enumerate "prototype" in the copy loop. With my FireFox 3.5.15, the JS example at http://jsfiddle.net/hBbJg/ will show a pop-up (thus buggy enumeration behavior). The "for ( name in options )" loop in "extend" falls prey to the same problem.
Changed January 09, 2011 07:28PM UTC by comment:8
Discussion on the same topic at Underscore.js: https://github.com/documentcloud/underscore/issues/issue/60
The page referenced does not provide any workaround that I could find. If you know of one, reopen the ticket and we will consider it.