#315 ✓resolved
ADO

ordering of objects used in Selector

Reported by ADO | August 29th, 2008 @ 12:11 PM | in 1.7

Selector.patterns (selector.js:310) is used as an ordered object - it is assumed that the members will be iterated over in the order they are added. The ECMAScript specification states that "an Object is an unordered collection of properties", so we cannot guarantee this.

This does not seem to cause a problem in any supported browser (they all iterate in the expected order), however it does cause problems with some other (proprietary) browsers. Tamarin uses hashtables to store object properties, so it is likely that similar issues will arise if it is included in Firefox 4.

Its also a bad idea because of the somewhat erratic ordering of members on IE - members of your [[Prototype]] in reverse order, members of the object itself in order, members of the objects in the prototype chain in order, going up the chain. If we ever have inheritance of these objects things will break in bizarre ways.

From my understanding of the code it looks like the best way of fixing this is to change the data structures around, and I don't feel confident doing that myself.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Attachments

Tags

Referenced by

Pages