From: crawshaw Date: Thu, 6 Jan 2005 19:55:58 +0000 (+0000) Subject: correct JSArray keys enumeration to return integers, not the values X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=commitdiff_plain;h=f1f7558304af1598272d935d46cab637aa001ef5 correct JSArray keys enumeration to return integers, not the values darcs-hash:20050106195558-2eb37-badf4bd9862d6d0ff199abb01804c18aa4033ff5.gz --- diff --git a/src/org/ibex/js/JSArray.java b/src/org/ibex/js/JSArray.java index 40974e3..cb06d0d 100644 --- a/src/org/ibex/js/JSArray.java +++ b/src/org/ibex/js/JSArray.java @@ -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 {