I've made changes to Rhino such that its default behavior is now only
to treat Iterables or Iterators specially when they are arguments to
the new Iterator constructor:

js> m = new java.util.HashMap()
{}
js> m.put("a",1)
null
js> m.put("b",2)
null
js> m
{a=1.0, b=2.0}
js> for (i in m.values()) print(i)
notifyAll
removeAll
containsAll
contains
empty
equals
notify
class
isEmpty
add
size
iterator
clear
wait
retainAll
toString
hashCode
toArray
addAll
getClass
remove
js> for (i in Iterator(m.values())) print(i)
1.0
2.0
js> for (i in Iterator(m.values().iterator())) print(i)
1.0
2.0
js>

Since Iterator is a new addition for 1.7, there are no issues for
backwards compatibility.

This still leaves open the possibility of top-level functions to wrap
Maps and Lists as JavaScript Objects and Arrays.

--N
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to