Opened 11 years ago

Closed 11 years ago

#8075 closed defect (invalid)

IE8: failure iterating StaticNodeList arrays

Reported by: bill Owned by: alex
Priority: high Milestone: 1.3
Component: Core Version: 1.2.1
Keywords: Cc: bill
Blocked By: Blocking:

Description

Our current way of parsing list of nodes in dojo.query() and other parts of the code is to do:

for(var x = 1, te; te = arr[x]; x++){

This loop stops running when it "falls off the end of the array", accessing array[x] when the array only has x entries.

Unfortunately, that fails on IE8 with a JS exception.

Presumably the more standard way of traversing lists works:

for(var i=0; i<ary.length; i++)

This bug appears in the NodeList.html test for the filter(), concat() etc. tests if you modify dojo.query() by removing this line:

r.nozip = true; // skip expensive duplication checks and just wrap in a NodeList

See #8074 for why I want to remove that line.

I assume it also shows up in dojo.query() tests, etc.

It would show up for any users that are iterating dojo.query() results in that way, although typically they should be iterating using dojo.query.forEach() etc., so I don't see that as a major issue.

Change History (2)

comment:1 Changed 11 years ago by dante

Cc: bill added
Milestone: tbd1.3
Owner: changed from anonymous to alex

this is likely fixed as part of QSA removal too. bill?

comment:2 Changed 11 years ago by bill

Resolution: invalid
Status: newclosed

Yah, I think so. Only querySelectorAll() returns StaticNodeLists?. More primitive methods return live-lists, or some such name.

Note: See TracTickets for help on using tickets.