xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Ley" <...@jibbering.com>
Subject Re: Strange behaviour of Rhino with associative array object
Date Sat, 18 Oct 2003 09:26:05 GMT

"Andreas Neumann" <neumann@karto.baug.ethz.ch> wrote in message

> Later on I use a "for ... in" loop to extract the values of the
> array.

This isn't really safe, because things in the prototype also can get
enumerated so if I do:

Array.prototype.chicken=function() {alert('a') }


for (i in n) alert(i)

will alert a and chicken

> It appears that the Rhino js engine automatically sorts alphabetically
> according to the index value, which means, that "Asians" come first, then
> Blacks", ....

Perfectly valid behaviour, there's no reliability on the ordering, it's
implementation specific, I'd recommend rewriting to avoid needing for i in a


To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message