On Dec 27, 9:46 am, Attila Szegedi <[EMAIL PROTECTED]> wrote:
> Now, Rhino will ignore getIds() if the
> wrapped object implements java.lang.Iterable, and for..in will iterate
> over values:
>
> for(i in x) { java.lang.System.out.println(i); }
>
> when "x" is a java.util.List will print the values, and will no longer
> print indices.
>
> Shouldn't getIds() still have priority?
That would be my vote, now that you mention it. In my view, it makes
sense to have:
for each (i in x) { ... }
iterate over the values, but for (i in x) should iterate over the
indices, I'd think.
> So, while we're at that, shouldn't we allow java.util.List instances
> to be treated identically to native Java arrays, similar to
> NativeJavaArray class? I know List is a Java 2 interface, and thus
> didn't exist back when Rhino (and LiveConnect) were originally
> created, but I think we should catch up with times...
Not sure here. LiveConnect is quite mature -- I'd think we'd want to
urge whoever controls the LiveConnect spec to "catch up with the
times" and then catch up with them. But I could be persuaded.
-- David P. Caldwell
http://www.inonit.com/
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino