Skip to main content

Bug Tracker

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

component: unfiledcore
resolution: → patchwelcome
status: newclosed

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.

Changed November 11, 2010 02:10PM UTC by dmethvin comment:3

Changed November 11, 2010 03:09PM UTC by rwaldron comment:4

Yikes! that was the link to the patch file. Thanks Dave.

Changed November 11, 2010 03:26PM UTC by timmolendijk comment:5

Yep I'm currently successfully using a similar work-around.

Changed November 19, 2010 06:44AM UTC by snover comment:6

#5523 is a duplicate of this ticket.

Changed January 04, 2011 01:53AM UTC by asmecher 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 timmolendijk comment:8

Discussion on the same topic at Underscore.js: https://github.com/documentcloud/underscore/issues/issue/60