Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#10203 closed defect (fixed)

Consider using a custom object for NodeList instead of augmented Array

Reported by: James Burke Owned by: Kris Zyp
Priority: high Milestone: 1.7
Component: Core Version: 1.4.0b
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

See the notes in this ticket, #9672: the Firebug profile places nearly half the time in the _mixin method when creating a NodeList. It may be better to use a custom object that has a defined prototype that we can control as the definition of NodeList with the array of matched elements as a property of it. Then allow something like a toArray() method to get a real array out.

Change History (6)

comment:1 Changed 13 years ago by bill

Description: modified (diff)

comment:2 Changed 10 years ago by bill

Owner: changed from James Burke to Kris Zyp
Status: newassigned

comment:3 Changed 10 years ago by bill

It would also probably fix the problem in #9991 (which I'm closing as a duplicate of this ticket):

var list = new dojo.NodeList();
list instanceof dojo.NodeList;

... and list.isInstanceOf(dojo.NodeList) will not work either because dojo.NodeList is not dojo.declare'd.

comment:4 Changed 10 years ago by bill

#9991 is a duplicate of this ticket.

comment:5 Changed 10 years ago by Kris Zyp

Resolution: fixed
Status: assignedclosed

This was fixed in 1.7. We are now extending Array instead of augmenting an array on browsers that support that (old IE browsers don't support extending Array, so they continue with the old behavior). And yes, I believe we experienced very significant performance gains by doing this.

comment:6 Changed 10 years ago by bill

Milestone: 2.01.7
Note: See TracTickets for help on using tickets.