correct JSArray keys enumeration to return integers, not the values
[org.ibex.js.git] / src / org / ibex / js / JSArray.java
index 40974e3..cb06d0d 100644 (file)
@@ -20,9 +20,9 @@ class JSArray extends Basket.Array implements JS, Basket.CompareFunc {
     public JS unclone() { return this; }
     public JS.Enumeration keys() throws JSExn {
         return new Enumeration(null) {
-            private int pos = 0;
-            public boolean _hasNext() { return pos < size(); }
-            public JS _next() { return (JS)JSArray.this.get(pos++); }
+            private int n = 0;
+            public boolean _hasNext() { return n < size(); }
+            public JS _next() { return Script.N(n++); }
         };
     }
     public JS get(JS key) throws JSExn {