projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move JS's Hashtable to JS.O
[org.ibex.core.git]
/
src
/
org
/
ibex
/
js
/
JSArray.java
diff --git
a/src/org/ibex/js/JSArray.java
b/src/org/ibex/js/JSArray.java
index
f29b79a
..
168bab3
100644
(file)
--- a/
src/org/ibex/js/JSArray.java
+++ b/
src/org/ibex/js/JSArray.java
@@
-5,7
+5,7
@@
import org.ibex.util.*;
import java.util.*;
/** A JavaScript JSArray */
import java.util.*;
/** A JavaScript JSArray */
-public class JSArray extends JS {
+public class JSArray extends JS.BT {
private static final Object NULL = new Object();
public JSArray() { }
private static final Object NULL = new Object();
public JSArray() { }
@@
-99,11
+99,11
@@
public class JSArray extends JS {
public Enumeration keys() {
return new Enumeration() {
public Enumeration keys() {
return new Enumeration() {
- int cur = 0;
- public boolean hasMoreElements() { return cur >= size(); }
+ private int n = size();
+ public boolean hasMoreElements() { return n > 0; }
public Object nextElement() {
public Object nextElement() {
- if (cur >= size()) throw new NoSuchElementException();
- return new Integer(cur++);
+ if(n == 0) throw new NoSuchElementException();
+ return new Integer(--n);
}
};
}
}
};
}