bugs 520 and 524
[org.ibex.core.git] / src / org / ibex / js / JSArray.java
index f29b79a..bf54947 100644 (file)
@@ -99,8 +99,8 @@ public class JSArray extends JS {
 
     public Enumeration keys() {
         return new Enumeration() {
-                int cur = 0;
-                public boolean hasMoreElements() { return cur >= size(); }
+                private int cur = 0;
+                public boolean hasMoreElements() { return cur < size(); }
                 public Object nextElement() {
                     if (cur >= size()) throw new NoSuchElementException();
                     return new Integer(cur++);